Package org.uberfire.security.authz
Interface AuthorizationManager
-
- All Known Implementing Classes:
DefaultAuthorizationManager
public interface AuthorizationManagerMain entry interface for querying the authorization management subsystem about user access to different system resources.It provides services for checking access to
Resourceinstances as well as services to check if a given permission has been granted to a user.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanauthorize(String permission, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(String, User, VotingStrategy)using the default voting strategy defined atPermissionManager.booleanauthorize(String permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check of the given permission has been granted to the user.booleanauthorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(Permission, User, VotingStrategy)using the default voting strategy defined atPermissionManager.booleanauthorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check of the given permission has been granted to the user.booleanauthorize(org.uberfire.security.Resource resource, Collection<org.uberfire.security.Contributor> contributors, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It checks whether user is one of the contributors of resource as well permissions to access resource from security admin screenbooleanauthorize(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(Resource, User, VotingStrategy)using the default voting strategy defined atPermissionManager.booleanauthorize(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the specified user can "access" a given resource.booleanauthorize(org.uberfire.security.Resource resource, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(Resource, ResourceAction, User)using the default voting strategy defined atPermissionManager.booleanauthorize(org.uberfire.security.Resource resource, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the given action can be performed over the specified resource or any of its dependent resource references (seeResource.getDependencies()).booleanauthorize(org.uberfire.security.ResourceType resourceType, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(ResourceType, ResourceAction, User, VotingStrategy)using the default voting strategy defined atPermissionManager.booleanauthorize(org.uberfire.security.ResourceType resourceType, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the given action can be performed over the specified resource or any of its dependent resource references (seeResource.getDependencies()).PermissionCheckcheck(String permission, org.jboss.errai.security.shared.api.identity.User user)It redirects tocheck(String, User, VotingStrategy)using the default voting strategy defined atPermissionManager.PermissionCheckcheck(String permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Creates a brand newPermissionCheckinstance which provides a fluent styled API for checking permissions.ResourceCheckcheck(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user)It redirects tocheck(Resource, User, VotingStrategy)using the default voting strategy defined atPermissionManager.ResourceCheckcheck(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Creates a brand newResourceCheckinstance which provides a fluent styled API for the checking of restricted actions overResourceinstances.ResourceCheckcheck(org.uberfire.security.ResourceType type, org.jboss.errai.security.shared.api.identity.User user)It redirects tocheck(ResourceType, User, VotingStrategy)using the default voting strategy defined atPermissionManager.ResourceCheckcheck(org.uberfire.security.ResourceType resourceType, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Creates a brand newResourceCheckinstance which provides a fluent styled API for the checking of restricted actions over aResourceType.voidinvalidate(org.jboss.errai.security.shared.api.identity.User user)Invalidate user related authorization data cached
-
-
-
Method Detail
-
authorize
boolean authorize(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the specified user can "access" a given resource. The term "access" refers to the ability to be able to reach, read or view a resource. For instance, read a file, view an item in the UI, etc.Notice the resource may have dependencies (
Resource.getDependencies()) to other resources, in such case the resource is only accessible if and only if one of its dependent references is accessible too.- Parameters:
resource- The resourceuser- The user instancevotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- true if access is granted, false otherwise.
-
authorize
boolean authorize(org.uberfire.security.Resource resource, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the given action can be performed over the specified resource or any of its dependent resource references (seeResource.getDependencies()).- Parameters:
resource- The resource instance to checkaction- The action to check. If null then theauthorize(Resource, User)method is invoked.user- The user instancevotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- true if the action is granted, false otherwise.
-
authorize
boolean authorize(org.uberfire.security.ResourceType resourceType, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)Check if the given action can be performed over the specified resource or any of its dependent resource references (seeResource.getDependencies()).- Parameters:
resourceType- The resource type to checkaction- The action to check.user- The user instancevotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- true if the action is granted, false otherwise.
-
authorize
boolean authorize(String permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)
Check of the given permission has been granted to the user.- Parameters:
permission- The name of the permission to checkuser- The user instancevotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- true if the permission is granted, false otherwise.
-
authorize
boolean authorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)
Check of the given permission has been granted to the user.- Parameters:
permission- The name of the permission to checkuser- The user instancevotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- true if the permission is granted, false otherwise.
-
check
ResourceCheck check(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)
Creates a brand newResourceCheckinstance which provides a fluent styled API for the checking of restricted actions overResourceinstances.ExampleUsage:
User user; Resource resource; AuthorizationManager authzManager; boolean result = authzManager.check(resource, user) .granted(() -> System.out.println("Access granted")) .denied(() -> System.out.println("Access denied")) .result();- Parameters:
resource- The resource to checkvotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- A
AuthorizationCheckinstance.
-
check
ResourceCheck check(org.uberfire.security.ResourceType resourceType, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)
Creates a brand newResourceCheckinstance which provides a fluent styled API for the checking of restricted actions over aResourceType.ExampleUsage:
User user; AuthorizationManager authzManager; boolean result = authzManager.check(ActivityResourceType.PERSPECTIVE, user) .granted(() -> System.out.println("Access granted")) .denied(() -> System.out.println("Access denied")) .result();- Parameters:
resourceType- The resource type to checkvotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- A
AuthorizationCheckinstance.
-
check
PermissionCheck check(String permission, org.jboss.errai.security.shared.api.identity.User user, org.uberfire.security.authz.VotingStrategy votingStrategy)
Creates a brand newPermissionCheckinstance which provides a fluent styled API for checking permissions.ExampleUsage:
User user; AuthorizationManager authzManager; boolean result = authzManager.check("myfeature", user) .granted(() -> System.out.println("Access granted")) .denied(() -> System.out.println("Access denied")) .result();- Parameters:
permission- The name of the permission to checkvotingStrategy- The voting strategy to use when voting is required (users with more than one role and/or group assigned).- Returns:
- A
AuthorizationCheckinstance.
-
authorize
boolean authorize(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(Resource, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
authorize
boolean authorize(org.uberfire.security.Resource resource, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(Resource, ResourceAction, User)using the default voting strategy defined atPermissionManager.
-
authorize
boolean authorize(org.uberfire.security.ResourceType resourceType, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It redirects toauthorize(ResourceType, ResourceAction, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
authorize
boolean authorize(String permission, org.jboss.errai.security.shared.api.identity.User user)
It redirects toauthorize(String, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
authorize
boolean authorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user)
It redirects toauthorize(Permission, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
authorize
boolean authorize(org.uberfire.security.Resource resource, Collection<org.uberfire.security.Contributor> contributors, org.uberfire.security.ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)It checks whether user is one of the contributors of resource as well permissions to access resource from security admin screen
-
check
ResourceCheck check(org.uberfire.security.Resource resource, org.jboss.errai.security.shared.api.identity.User user)
It redirects tocheck(Resource, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
check
ResourceCheck check(org.uberfire.security.ResourceType type, org.jboss.errai.security.shared.api.identity.User user)
It redirects tocheck(ResourceType, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
check
PermissionCheck check(String permission, org.jboss.errai.security.shared.api.identity.User user)
It redirects tocheck(String, User, VotingStrategy)using the default voting strategy defined atPermissionManager.
-
invalidate
void invalidate(org.jboss.errai.security.shared.api.identity.User user)
Invalidate user related authorization data cached- Parameters:
user- user to invalidate cache
-
-