@Target(value=TYPE)
@Retention(value=RUNTIME)
@Component
public @interface Role
cuba.rolesStorageMode
equals SOURCE_CODE
or MIXED
).
The easiest way to determine the role in the application source code is to extend
your class from AnnotatedRoleDefinition
and mark it with this annotation. Usage example:
@Role(name = "My first role", isDefault = true) public class MyFirstRole extends AnnotatedRoleDefinition { @EntityAccess(entityClass = SomeEntity.class, operations = {EntityOp.DELETE, EntityOp.UPDATE}) @Override public EntityPermissionsContainer entityPermissions() { return super.entityPermissions(); } @EntityAttributeAccess(entityClass = SomeEntity.class, view = {"someAttribute", "attr2"}, modify = {"attr3", "attr4"}) @Override public EntityAttributePermissionsContainer entityAttributePermissions() { return super.entityAttributePermissions(); } @SpecificAccess(permissions = {"my.specific.permission1", "my.specific.permission2"}) @Override public SpecificPermissionsContainer specificPermissions() { return super.specificPermissions(); } @ScreenAccess(screenIds = {"myapp_SomeEntity.edit", "myapp_OtherEntity.browse"}) @Override public ScreenPermissionsContainer screenPermissions() { return super.screenPermissions(); } @ScreenComponentAccess(screenId = "myapp_SomeEntity.browse", deny = {"someGroupBox"}) @Override public ScreenComponentPermissionsContainer screenComponentPermissions() { return super.screenComponentPermissions(); } }
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
name
Role name.
|
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
description
Description of the role.
|
boolean |
isDefault
Determines if the role is default.
|
boolean |
isSuper
Determines if the role is super.
|
java.lang.String |
securityScope
Determines security scope for the role.
|
java.lang.String |
value |