@ApplicationScoped public class DefaultAuthorizationManager extends Object implements AuthorizationManager
Constructor and Description |
---|
DefaultAuthorizationManager() |
DefaultAuthorizationManager(PermissionManager permissionManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
authorize(Permission permission,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.authorize(Permission, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
boolean |
authorize(Permission permission,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Check of the given permission has been granted to the user.
|
boolean |
authorize(Resource resource,
ResourceAction action,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.authorize(Resource, ResourceAction, User)
using the default voting strategy defined at PermissionManager . |
boolean |
authorize(Resource resource,
ResourceAction action,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Check if the given action can be performed over the specified resource or any of its
dependent resource references (see
Resource.getDependencies() ). |
boolean |
authorize(ResourceType resourceType,
ResourceAction action,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.authorize(ResourceType, ResourceAction, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
boolean |
authorize(ResourceType resourceType,
ResourceAction action,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Check if the given action can be performed over the specified resource or any of its
dependent resource references (see
Resource.getDependencies() ). |
boolean |
authorize(Resource resource,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.authorize(Resource, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
boolean |
authorize(Resource resource,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Check if the specified user can "access" a given resource.
|
boolean |
authorize(String permission,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.authorize(String, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
boolean |
authorize(String permission,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Check of the given permission has been granted to the user.
|
ResourceCheck |
check(ResourceType target,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.check(ResourceType, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
ResourceCheck |
check(ResourceType target,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Creates a brand new
ResourceCheck instance which provides a fluent styled API for
the checking of restricted actions over a ResourceType . |
ResourceCheck |
check(Resource target,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.check(Resource, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
ResourceCheck |
check(Resource target,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Creates a brand new
ResourceCheck instance which provides a fluent styled API for
the checking of restricted actions over Resource instances. |
PermissionCheck |
check(String permission,
org.jboss.errai.security.shared.api.identity.User user)
It redirects to
AuthorizationManager.check(String, User, VotingStrategy)
using the default voting strategy defined at PermissionManager . |
PermissionCheck |
check(String permission,
org.jboss.errai.security.shared.api.identity.User user,
VotingStrategy votingStrategy)
Creates a brand new
PermissionCheck instance which provides a
fluent styled API for checking permissions. |
public DefaultAuthorizationManager()
@Inject public DefaultAuthorizationManager(PermissionManager permissionManager)
public boolean authorize(Resource resource, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.authorize(Resource, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.authorize
in interface AuthorizationManager
public boolean authorize(Resource resource, ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.authorize(Resource, ResourceAction, User)
using the default voting strategy defined at PermissionManager
.authorize
in interface AuthorizationManager
public boolean authorize(ResourceType resourceType, ResourceAction action, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.authorize(ResourceType, ResourceAction, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.authorize
in interface AuthorizationManager
public boolean authorize(Resource resource, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
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.
authorize
in interface AuthorizationManager
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).public boolean authorize(Resource resource, ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
Resource.getDependencies()
).authorize
in interface AuthorizationManager
resource
- The resource instance to checkaction
- The action to check. If null then the AuthorizationManager.authorize(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).public boolean authorize(ResourceType resourceType, ResourceAction action, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
Resource.getDependencies()
).authorize
in interface AuthorizationManager
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).public boolean authorize(String permission, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.authorize(String, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.authorize
in interface AuthorizationManager
public boolean authorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.authorize(Permission, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.authorize
in interface AuthorizationManager
public boolean authorize(String permission, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
authorize
in interface AuthorizationManager
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).public boolean authorize(Permission permission, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
authorize
in interface AuthorizationManager
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).public ResourceCheck check(Resource target, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.check(Resource, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.check
in interface AuthorizationManager
public ResourceCheck check(Resource target, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
ResourceCheck
instance which provides a fluent styled API for
the checking of restricted actions over Resource
instances.
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();
check
in interface AuthorizationManager
target
- The resource to checkvotingStrategy
- The voting strategy to use when voting is required
(users with more than one role and/or group assigned).AuthorizationCheck
instance.public ResourceCheck check(ResourceType target, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.check(ResourceType, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.check
in interface AuthorizationManager
public ResourceCheck check(ResourceType target, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
ResourceCheck
instance which provides a fluent styled API for
the checking of restricted actions over a ResourceType
.
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();
check
in interface AuthorizationManager
target
- The resource type to checkvotingStrategy
- The voting strategy to use when voting is required
(users with more than one role and/or group assigned).AuthorizationCheck
instance.public PermissionCheck check(String permission, org.jboss.errai.security.shared.api.identity.User user)
AuthorizationManager
AuthorizationManager.check(String, User, VotingStrategy)
using the default voting strategy defined at PermissionManager
.check
in interface AuthorizationManager
public PermissionCheck check(String permission, org.jboss.errai.security.shared.api.identity.User user, VotingStrategy votingStrategy)
AuthorizationManager
PermissionCheck
instance 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();
check
in interface AuthorizationManager
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).AuthorizationCheck
instance.Copyright © 2012–2018 JBoss by Red Hat. All rights reserved.