Class Permission
- All Implemented Interfaces:
IPermission
- Direct Known Subclasses:
AdministrationPermission
,ChangePasswordPermission
,DownloadFromBIRPermission
,LoginPermission
,ReportPermission
,UserManagementPermission
IPermission
implementation. All other implementations
must extend this class.
Every implementation must provide public constructor with String
parameter,
so that the permissions can be automatically constructed by the security framework.
The implementators are expected to override the getParentPermissions()
and getDynamicRoles(String)
methods, but might not override the
equals(Object)
and hashCode()
methods, which must be based
solely on the name
comparison in order to work.
- Author:
- dobisekm
-
Field Summary
FieldsFields inherited from interface com.polarion.platform.security.IPermission
SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondenied
(String user, IPermission originalPermission, IContextId contextId) final boolean
getDynamicRoles
(String user) Returns the collection of role IDs of dynamic roles associated with this particular permission.getName()
The permission's name.The collection of permissions, to which the decision about this permission is granted, if there is no record for exactly this permission.final int
hashCode()
isInCustomSet
(String customSet) Checks if the permission of the concrete object is in the provided custom set.toString()
-
Field Details
-
name
-
-
Constructor Details
-
Permission
-
-
Method Details
-
getName
Description copied from interface:IPermission
The permission's name. Permission names are typically dot '.' separated series of strings (e.g. as packege+class names).- Specified by:
getName
in interfaceIPermission
- Returns:
- The name, never
null
.
-
getParentPermissions
Description copied from interface:IPermission
The collection of permissions, to which the decision about this permission is granted, if there is no record for exactly this permission.For permission to be granted, none of it's parents can be denied and at least one of them must be granted. The rest can be either undefined or granted.
- Specified by:
getParentPermissions
in interfaceIPermission
- Returns:
- array of
IPermission
s (notnull
)
-
getDynamicRoles
Description copied from interface:IPermission
Returns the collection of role IDs of dynamic roles associated with this particular permission.Dynamic roles are determined by particular permission data and by the relationship between the data and the user. The permission is allowed to perform operations which may lead to the test of the same permission - clients of this method must be aware of it.
- Specified by:
getDynamicRoles
in interfaceIPermission
- Parameters:
user
- name of current user- Returns:
- Empty
Collection
if there are no dynamic roles, orcollection of String
role Ids.
-
hashCode
public final int hashCode() -
equals
-
toString
-
isInCustomSet
Description copied from interface:IPermission
Checks if the permission of the concrete object is in the provided custom set. A custom set is a Lucene query which groups a permission to all objects satisfying the query.- Specified by:
isInCustomSet
in interfaceIPermission
- Parameters:
customSet
- - the custom set (Lucene query syntax)- Returns:
true
if the IPObject inside the permission satisfies the query (belongs to that customSet),false
if custom set isnull
or object does not belong to the custom set.null
if the caller should assume that the information cannot be determined- Since:
- 3.8.1
-
denied
@NotNull public PermissionDeniedException denied(@Nullable String user, @NotNull IPermission originalPermission, @Nullable IContextId contextId) - Since:
- 3.8.2
-