public class DotNamedPermissionType extends Object implements PermissionType
| Constructor and Description |
|---|
DotNamedPermissionType(String type) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildPermissionName(ResourceType type,
String action,
String resourceId) |
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.
|
public DotNamedPermissionType(String type)
public String getType()
PermissionTypegetType in interface PermissionTypepublic boolean supportsPermission(String name)
PermissionTypesupportsPermission in interface PermissionTypename - The permission name to checkpublic Permission createPermission(String name, boolean granted)
PermissionTypecreatePermission in interface PermissionTypename - The name of the permission to create.granted - true=granted, false=deniedpublic Permission createPermission(ResourceType resourceType, ResourceAction action, boolean granted)
PermissionTypecreatePermission in interface PermissionTyperesourceType - 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.public Permission createPermission(Resource resource, ResourceAction action, boolean granted)
PermissionTypecreatePermission in interface PermissionTyperesource - 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.public String resolveResourceId(Permission permission)
PermissionType
The resolution mechanism works only if the permission instance was created by a previous call
to PermissionType.createPermission(Resource, ResourceAction, boolean). In such case the identifier of the
Resource instance is the value returned.
resolveResourceId in interface PermissionTypepermission - The permission which resource id. has to be inferred.protected String buildPermissionName(ResourceType type, String action, String resourceId)
Copyright © 2012–2017 JBoss by Red Hat. All rights reserved.