@Component(value="cuba_Security") public class SecurityImpl extends java.lang.Object implements Security
Constructor and Description |
---|
SecurityImpl() |
Modifier and Type | Method and Description |
---|---|
void |
checkSpecificPermission(java.lang.String name)
Check if current user has a specific permission.
|
java.lang.Object |
evaluateConstraintScript(Entity entity,
java.lang.String groovyScript) |
boolean |
hasConstraints(MetaClass metaClass)
Check if there are registered constraints for the metaClass or it's original metaClass
|
boolean |
hasInMemoryConstraints(MetaClass metaClass,
ConstraintOperationType... operationTypes)
Check if there are registered memory constraints of specified
operationTypes for the metaClass or it's original metaClass |
boolean |
isEntityAttrPermitted(java.lang.Class<?> entityClass,
java.lang.String property,
EntityAttrAccess access)
Check if current user has permission to an entity attribute.
|
boolean |
isEntityAttrPermitted(MetaClass metaClass,
java.lang.String property,
EntityAttrAccess access)
Check if current user has permission to an entity attribute.
|
boolean |
isEntityAttrReadPermitted(MetaClass metaClass,
java.lang.String propertyPath)
Check if current user can read an entity attribute which is the last part of the path given.
|
boolean |
isEntityAttrUpdatePermitted(MetaClass metaClass,
java.lang.String propertyPath)
Check if current user can modify an entity attribute which is the last part of the path given.
|
boolean |
isEntityOpPermitted(java.lang.Class<?> entityClass,
EntityOp entityOp)
Check if current user has permission to execute an entity operation.
|
boolean |
isEntityOpPermitted(MetaClass metaClass,
EntityOp entityOp)
Check if current user has permission to execute an entity operation.
|
boolean |
isPermitted(Entity entity,
ConstraintOperationType targetOperationType)
Check if the operation type is permitted for the entity
|
boolean |
isPermitted(Entity entity,
java.lang.String customCode)
Check the special constraint permission for the entity
|
boolean |
isScreenPermitted(java.lang.String windowAlias)
Check if current user has permission to open a screen.
|
boolean |
isSpecificPermitted(java.lang.String name)
Check if current user has a specific permission.
|
public boolean isScreenPermitted(java.lang.String windowAlias)
Security
isScreenPermitted
in interface Security
windowAlias
- screen id as registered in screens.xml
public boolean isEntityOpPermitted(MetaClass metaClass, EntityOp entityOp)
Security
isEntityOpPermitted
in interface Security
metaClass
- entity meta-classentityOp
- operationpublic boolean isEntityOpPermitted(java.lang.Class<?> entityClass, EntityOp entityOp)
Security
isEntityOpPermitted
in interface Security
entityClass
- entity classentityOp
- operationpublic boolean isEntityAttrPermitted(MetaClass metaClass, java.lang.String property, EntityAttrAccess access)
Security
isEntityAttrPermitted
in interface Security
metaClass
- entity meta-classproperty
- entity attribute nameaccess
- required accesspublic boolean isEntityAttrPermitted(java.lang.Class<?> entityClass, java.lang.String property, EntityAttrAccess access)
Security
isEntityAttrPermitted
in interface Security
entityClass
- entity classproperty
- entity attribute nameaccess
- required accesspublic boolean isEntityAttrReadPermitted(MetaClass metaClass, java.lang.String propertyPath)
Security
EntityOp.READ
on the whole entity which the attribute belongs toEntityAttrAccess.VIEW
on the attributeisEntityAttrReadPermitted
in interface Security
metaClass
- entity meta classpropertyPath
- entity attribute pathpublic boolean isEntityAttrUpdatePermitted(MetaClass metaClass, java.lang.String propertyPath)
Security
EntityOp.CREATE
or EntityOp.UPDATE
on the whole entity which the attribute belongs toEntityAttrAccess.MODIFY
on the attributeisEntityAttrUpdatePermitted
in interface Security
metaClass
- entity meta classpropertyPath
- entity attribute pathpublic boolean isSpecificPermitted(java.lang.String name)
Security
isSpecificPermitted
in interface Security
name
- specific permission idpublic void checkSpecificPermission(java.lang.String name)
Security
checkSpecificPermission
in interface Security
name
- specific permission idpublic boolean isPermitted(Entity entity, ConstraintOperationType targetOperationType)
Security
isPermitted
in interface Security
public boolean isPermitted(Entity entity, java.lang.String customCode)
Security
isPermitted
in interface Security
public boolean hasConstraints(MetaClass metaClass)
Security
hasConstraints
in interface Security
public boolean hasInMemoryConstraints(MetaClass metaClass, ConstraintOperationType... operationTypes)
Security
operationTypes
for the metaClass or it's original metaClasshasInMemoryConstraints
in interface Security
public java.lang.Object evaluateConstraintScript(Entity entity, java.lang.String groovyScript)
evaluateConstraintScript
in interface Security