Package org.uberfire.security.authz
Interface AuthorizationPolicy
-
- All Known Implementing Classes:
DefaultAuthorizationPolicy
public interface AuthorizationPolicyIt holds a registry of permission collections assigned to individual Role and Group instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddPermission(org.jboss.errai.security.shared.api.Group group, Permission permission)Add a single permission entry for a group.StringgetGroupDescription(org.jboss.errai.security.shared.api.Group group)Get the description of an existing group.Set<org.jboss.errai.security.shared.api.Group>getGroups()Get the collection of groups this policy is related to.StringgetHomePerspective()Gets the identifier of the default home perspective.StringgetHomePerspective(org.jboss.errai.security.shared.api.Group group)Get the identifier of the home perspective assigned to the given group.StringgetHomePerspective(org.jboss.errai.security.shared.api.identity.User user)Get the identifier of the perspective this user is redirected by default.StringgetHomePerspective(org.jboss.errai.security.shared.api.Role role)Get the identifier of the home perspective assigned to the given group.PermissionCollectiongetPermissions()Get the default permissions.PermissionCollectiongetPermissions(org.jboss.errai.security.shared.api.Group group)Get the permissions assigned to a given group.PermissionCollectiongetPermissions(org.jboss.errai.security.shared.api.Role role)Get the permissions assigned to a given role.intgetPriority(org.jboss.errai.security.shared.api.Group group)Get a group's priority.intgetPriority(org.jboss.errai.security.shared.api.Role role)Get a role's priority.StringgetRoleDescription(org.jboss.errai.security.shared.api.Role role)Get the description of an existing role.Set<org.jboss.errai.security.shared.api.Role>getRoles()Get the collection of roles this policy is related to.voidsetGroupDescription(org.jboss.errai.security.shared.api.Group group, String description)Sets a description for an existing group.voidsetHomePerspective(String perspectiveId)Sets the identifier of the default home perspective.voidsetHomePerspective(org.jboss.errai.security.shared.api.Group group, String perspectiveId)Set the identifier of the home perspective assigned to the given group.voidsetHomePerspective(org.jboss.errai.security.shared.api.Role role, String perspectiveId)Set the identifier of the home perspective assigned to the given role.voidsetPermissions(org.jboss.errai.security.shared.api.Group group, PermissionCollection permissions)Set the group's permissionsvoidsetPermissions(org.jboss.errai.security.shared.api.Role role, PermissionCollection permissions)Set the role's permissionsvoidsetPriority(org.jboss.errai.security.shared.api.Group group, int priority)Set the group's priorityvoidsetPriority(org.jboss.errai.security.shared.api.Role role, int priority)Set the role's priorityvoidsetRoleDescription(org.jboss.errai.security.shared.api.Role role, String description)Sets a description for an existing role.
-
-
-
Method Detail
-
getRoles
Set<org.jboss.errai.security.shared.api.Role> getRoles()
Get the collection of roles this policy is related to.
-
getGroups
Set<org.jboss.errai.security.shared.api.Group> getGroups()
Get the collection of groups this policy is related to.
-
getRoleDescription
String getRoleDescription(org.jboss.errai.security.shared.api.Role role)
Get the description of an existing role.- Parameters:
role- The role- Returns:
- The role description
-
setRoleDescription
void setRoleDescription(org.jboss.errai.security.shared.api.Role role, String description)Sets a description for an existing role.- Parameters:
role- The roledescription- A non empty description
-
getGroupDescription
String getGroupDescription(org.jboss.errai.security.shared.api.Group group)
Get the description of an existing group.- Parameters:
group- The group- Returns:
- The group description
-
setGroupDescription
void setGroupDescription(org.jboss.errai.security.shared.api.Group group, String description)Sets a description for an existing group.- Parameters:
group- The group identifierdescription- A non empty description
-
getPriority
int getPriority(org.jboss.errai.security.shared.api.Role role)
Get a role's priority. The priority is important during permission resolution and when a user is assigned to more than one role/group it is used to determine what is the most priority.- Parameters:
role- The role instance- Returns:
- An integer. The highest, the more priority the collection is. Default priority value is 0.
-
getPriority
int getPriority(org.jboss.errai.security.shared.api.Group group)
Get a group's priority. The priority is important during permission resolution and when a user is assigned to more than one role/group it is used to determine what is the most priority.- Parameters:
group- The group instance- Returns:
- An integer. The highest, the more priority the collection is. Default priority value is 0.
-
setPriority
void setPriority(org.jboss.errai.security.shared.api.Role role, int priority)Set the role's priority- Parameters:
role- The role instancepriority- Any valid integer. The highest, the more priority the role is.
-
setPriority
void setPriority(org.jboss.errai.security.shared.api.Group group, int priority)Set the group's priority- Parameters:
group- The group instancepriority- Any valid integer. The highest, the more priority the role is.
-
getPermissions
PermissionCollection getPermissions(org.jboss.errai.security.shared.api.Role role)
Get the permissions assigned to a given role.- Parameters:
role- The role instance- Returns:
- The permission collection. Notice, the default permission collection is also included in the results.
-
setPermissions
void setPermissions(org.jboss.errai.security.shared.api.Role role, PermissionCollection permissions)Set the role's permissions- Parameters:
role- The role instancepermissions- A permission collection
-
getPermissions
PermissionCollection getPermissions(org.jboss.errai.security.shared.api.Group group)
Get the permissions assigned to a given group.- Parameters:
group- The group instance- Returns:
- The permission collection. Notice, the default permission collection is also included in the results.
-
setPermissions
void setPermissions(org.jboss.errai.security.shared.api.Group group, PermissionCollection permissions)Set the group's permissions- Parameters:
group- The group instancepermissions- A permission collection
-
getHomePerspective
String getHomePerspective(org.jboss.errai.security.shared.api.Role role)
Get the identifier of the home perspective assigned to the given group.- Returns:
- An existing perspective identifier
-
getHomePerspective
String getHomePerspective(org.jboss.errai.security.shared.api.Group group)
Get the identifier of the home perspective assigned to the given group.- Returns:
- An existing perspective identifier
-
setHomePerspective
void setHomePerspective(org.jboss.errai.security.shared.api.Role role, String perspectiveId)Set the identifier of the home perspective assigned to the given role.- Parameters:
role- The target role instanceperspectiveId- An existing perspective identifier
-
setHomePerspective
void setHomePerspective(org.jboss.errai.security.shared.api.Group group, String perspectiveId)Set the identifier of the home perspective assigned to the given group.- Parameters:
group- The target group instanceperspectiveId- An existing perspective identifier
-
getHomePerspective
String getHomePerspective(org.jboss.errai.security.shared.api.identity.User user)
Get the identifier of the perspective this user is redirected by default.If the user is assigned with more than one role or group then the most priority one is taken.
- Returns:
- An existing perspective identifier
- See Also:
getPriority(Role),getPriority(Group)
-
getHomePerspective
String getHomePerspective()
Gets the identifier of the default home perspective.This is the perspective that is returned for those roles/groups with no home perspective set.
- Returns:
- An existing perspective identifier
-
setHomePerspective
void setHomePerspective(String perspectiveId)
Sets the identifier of the default home perspective.This is the perspective that is returned for those roles/groups with no gome perspective set.
- Parameters:
perspectiveId- An existing perspective identifier
-
getPermissions
PermissionCollection getPermissions()
Get the default permissions.These are he permissions that are returned for those roles/groups with no permissions set.
- Returns:
- The permission collection
-
addPermission
void addPermission(org.jboss.errai.security.shared.api.Group group, Permission permission)Add a single permission entry for a group.- Parameters:
group- The group instancepermission- A permission instance
-
-