public interface PermissionType
Modifier and Type | Method and Description |
---|---|
Permission |
createPermission(Resource resource,
ResourceAction action,
boolean granted)
Creates a permission instance representing an action on a given resource..
|
Permission |
createPermission(ResourceType resourceType,
ResourceAction action,
boolean granted)
Creates a permission instance representing a "global" action that can be applied to any resource instance
(for instance, "edit an invoice") or an action that is not related to any specific instance (for instance,
"create a new invoice")
|
Permission |
createPermission(String name,
boolean granted)
Creates a permission instance.
|
String |
getType()
An string identifier that acts as a unique identifier for the permission type.
|
String |
resolveResourceId(Permission permission)
Given a permission it tries to determine what is the resource the permission refers to.
|
boolean |
supportsPermission(String name)
Checks if the given permission name is supported by this type.
|
String getType()
boolean supportsPermission(String name)
name
- The permission name to checkPermission createPermission(String name, boolean granted)
name
- The name of the permission to create.granted
- true=granted, false=deniedPermission createPermission(ResourceType resourceType, ResourceAction action, boolean granted)
resourceType
- The resource typeaction
- The action to check. If null then an "access" permission is created.
The term access refers to the ability to reach, read, view ... the resource, depending on the resource type.Permission createPermission(Resource resource, ResourceAction action, boolean granted)
resource
- The resource instanceaction
- The action to check. If null then an "access" permission is created.
The term access refers to the ability to reach, read, view ... the resource, depending on the resource type.String resolveResourceId(Permission permission)
The resolution mechanism works only if the permission instance was created by a previous call
to createPermission(Resource, ResourceAction, boolean)
. In such case the identifier of the
Resource
instance is the value returned.
permission
- The permission which resource id. has to be inferred.Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.