@Component(value="cuba_AttributeAccessSupport")
public class AttributeAccessSupport
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AttributeAccessSupport.ComponentState |
Modifier and Type | Field and Description |
---|---|
protected AttributeAccessUpdater |
attributeAccessUpdater |
static java.lang.String |
NAME |
protected Security |
security |
Constructor and Description |
---|
AttributeAccessSupport() |
Modifier and Type | Method and Description |
---|---|
void |
applyAttributeAccess(FrameOwner frameOwner,
boolean reset)
Apply attribute access rules to a given frame.
|
void |
applyAttributeAccess(FrameOwner frameOwner,
boolean reset,
Entity... entities)
Apply attribute access rules to a given frame according to the state of the given entities.
|
protected AttributeAccessSupport.ComponentState |
calculateComponentState(Entity entity,
MetaPropertyPath propertyPath) |
protected SecurityState |
getSecurityState(Entity entity) |
protected boolean |
test(boolean value,
java.util.Collection<java.lang.String> attributes,
java.lang.String name) |
protected void |
visitComponent(Component component,
boolean reset) |
public static final java.lang.String NAME
@Inject protected AttributeAccessUpdater attributeAccessUpdater
@Inject protected Security security
public void applyAttributeAccess(FrameOwner frameOwner, boolean reset)
frameOwner
- frame or screenreset
- whether to reset the components to the default state specified by role-based security and model
annotations. If you invoke this method to apply attribute access to already opened screen, set
the parameter to true, but keep in mind that previous programmatic changes in the components
visible/read-only/required state will be lost.public void applyAttributeAccess(FrameOwner frameOwner, boolean reset, Entity... entities)
entities
- list of instances that should recalculate their security stateframeOwner
- frame or screenreset
- whether to reset the components to the default state specified by role-based security and model
annotations. If you invoke this method to apply attribute access to already opened screen, set
the parameter to true, but keep in mind that previous programmatic changes in the components
visible/read-only/required state will be lost.protected void visitComponent(Component component, boolean reset)
protected AttributeAccessSupport.ComponentState calculateComponentState(Entity entity, MetaPropertyPath propertyPath)
protected SecurityState getSecurityState(Entity entity)
protected boolean test(boolean value, java.util.Collection<java.lang.String> attributes, java.lang.String name)