@Component(value="cuba_AttributeSecuritySupport")
public class AttributeSecuritySupport
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
AttributeSecuritySupport.AttributeAccessVisitor |
protected class |
AttributeSecuritySupport.ClearInaccessibleAttributesVisitor |
protected class |
AttributeSecuritySupport.FillingInaccessibleAttributesVisitor |
Modifier and Type | Field and Description |
---|---|
protected ServerConfig |
config |
protected EntityStates |
entityStates |
protected Events |
events |
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
static java.lang.String |
NAME |
protected PersistenceSecurity |
security |
protected SecurityTokenManager |
securityTokenManager |
Constructor and Description |
---|
AttributeSecuritySupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterCommit(Entity entity)
Should be called after merging an entity and transaction commit.
|
void |
afterLoad(java.util.Collection<? extends Entity> entities)
Should be called after loading a list of entities from the database.
|
void |
afterLoad(Entity entity)
Should be called after loading an entity from the database.
|
void |
afterMerge(Entity entity)
Should be called after merging an entity and before transaction commit.
|
void |
afterPersist(Entity entity,
View view)
Should be called after persisting a new entity.
|
protected void |
applySecurityToFetchGroup(Entity entity) |
void |
beforeMerge(Entity entity)
Should be called before merging an entity.
|
void |
beforePersist(Entity entity)
Should be called before persisting a new entity.
|
protected void |
checkRequiredAttributes(Entity entity) |
View |
createRestrictedView(View view)
Removes restricted attributes from a view.
|
boolean |
isAttributeAccessEnabled()
Checks if attribute access enabled (if SetupAttributeAccessHandlers exist)
|
boolean |
isAttributeAccessEnabled(com.haulmont.chile.core.model.MetaClass metaClass)
Checks if attribute access enabled for the current entity type.
|
void |
onLoad(java.util.Collection<? extends Entity> entities,
View view) |
void |
onLoad(Entity entity,
View view) |
protected void |
setNullPropertyValue(Entity entity,
com.haulmont.chile.core.model.MetaProperty property) |
<T extends Entity> |
setupAttributeAccess(T entity) |
public static final java.lang.String NAME
@Inject protected Metadata metadata
@Inject protected MetadataTools metadataTools
@Inject protected PersistenceSecurity security
@Inject protected ServerConfig config
@Inject protected SecurityTokenManager securityTokenManager
@Inject protected Events events
@Inject protected EntityStates entityStates
public View createRestrictedView(View view)
view
- source viewpublic void afterLoad(Entity entity)
entity
- just loaded detached entitypublic void afterLoad(java.util.Collection<? extends Entity> entities)
entities
- list of just loaded detached entitiespublic void beforePersist(Entity entity)
entity
- new entitypublic void afterPersist(Entity entity, View view)
entity
- new entityview
- entity viewpublic void beforeMerge(Entity entity)
entity
- detached entitypublic void afterMerge(Entity entity)
entity
- detached entitypublic void afterCommit(Entity entity)
entity
- detached entitypublic <T extends Entity> void setupAttributeAccess(T entity)
public boolean isAttributeAccessEnabled(com.haulmont.chile.core.model.MetaClass metaClass)
metaClass
- - entity metaClasspublic boolean isAttributeAccessEnabled()
protected void checkRequiredAttributes(Entity entity)
protected void applySecurityToFetchGroup(Entity entity)
protected void setNullPropertyValue(Entity entity, com.haulmont.chile.core.model.MetaProperty property)