Class FieldAccessInjector
- java.lang.Object
-
- org.openbravo.role.inheritance.access.AccessTypeInjector
-
- org.openbravo.role.inheritance.access.FieldAccessInjector
-
- All Implemented Interfaces:
Comparable<AccessTypeInjector>
public class FieldAccessInjector extends AccessTypeInjector
AccessTypeInjector for the FieldAccess class
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.role.inheritance.access.AccessTypeInjector
AccessTypeInjector.Qualifier, AccessTypeInjector.Selector
-
-
Constructor Summary
Constructors Constructor Description FieldAccessInjector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPriority()
Returns the priority of this injector.Role
getRole(InheritedAccessEnabled access)
Returns the role which the access given as parameter is assigned to.String
getRoleProperty()
Returns the role property related to the entity represented by the injector.String
getSecuredElementGetter()
Returns the secured object.String
getSecuredElementName()
Returns the secured element name.void
removeReferenceInParentList(InheritedAccessEnabled access)
Removes references to child elements from the parent list.void
setParent(InheritedAccessEnabled newAccess, InheritedAccessEnabled parentAccess, Role role)
Sets the parent for an inheritable access object.-
Methods inherited from class org.openbravo.role.inheritance.access.AccessTypeInjector
addEntityWhereClause, checkAccessExistence, clearInheritedFromField, clearInheritedFromField, clearInheritFromFieldInChilds, compareTo, doEntityParameterReplacement, findAccess, getAccessList, getClassName, getSecuredElementIdentifier, getSkippedProperties, isInheritable
-
-
-
-
Method Detail
-
getSecuredElementGetter
public String getSecuredElementGetter()
Description copied from class:AccessTypeInjector
Returns the secured object.- Specified by:
getSecuredElementGetter
in classAccessTypeInjector
- Returns:
- a String with the name of the method to retrieve the secured element
-
getPriority
public int getPriority()
Description copied from class:AccessTypeInjector
Returns the priority of this injector. It is used to determine the order when adding, updating or removing a particular access, if needed.- Overrides:
getPriority
in classAccessTypeInjector
- Returns:
- an integer that represents the priority of this injector
-
getSecuredElementName
public String getSecuredElementName()
Description copied from class:AccessTypeInjector
Returns the secured element name.- Specified by:
getSecuredElementName
in classAccessTypeInjector
- Returns:
- a String with the name of the secured element
-
getRole
public Role getRole(InheritedAccessEnabled access)
Description copied from class:AccessTypeInjector
Returns the role which the access given as parameter is assigned to. In general, the most part of inheritable accesses have Role as their parent entity. If not, this method must be overridden to retrieve the Role property for their particular case.- Overrides:
getRole
in classAccessTypeInjector
- Parameters:
access
- An inheritable access- Returns:
- the Role owner of the access
-
getRoleProperty
public String getRoleProperty()
Description copied from class:AccessTypeInjector
Returns the role property related to the entity represented by the injector.- Overrides:
getRoleProperty
in classAccessTypeInjector
- Returns:
- the role property that can be retrieved according to the entity of the injector.
-
setParent
public void setParent(InheritedAccessEnabled newAccess, InheritedAccessEnabled parentAccess, Role role)
Description copied from class:AccessTypeInjector
Sets the parent for an inheritable access object.- Overrides:
setParent
in classAccessTypeInjector
- Parameters:
newAccess
- Access whose parent object will be setparentAccess
- Access that is used in some cases to find the correct parentrole
- Parent role to set directly when applies
-
removeReferenceInParentList
public void removeReferenceInParentList(InheritedAccessEnabled access)
Description copied from class:AccessTypeInjector
Removes references to child elements from the parent list. Using this method prevents the "deleted object would be re-saved by cascade" error. This can happen, for example, after deleting an inherited TabAccess or FieldAccess.- Overrides:
removeReferenceInParentList
in classAccessTypeInjector
- Parameters:
access
- The access to be removed from the parent list
-
-