public final class Permissions extends RecordPackWrapper
Modifier and Type | Method and Description |
---|---|
void |
addPermission(java.lang.String userOrRole,
java.lang.String permission)
Adds for the specified role or user the given permission.
|
void |
addPermission(java.lang.String userOrRole,
java.lang.String permission,
boolean childPermissions)
Adds for the specified role or user the given permission.
|
void |
copyFrom(Permissions permissions)
Replaces all permissions with the permissions from the given permissions block.
|
int |
getCatalogID()
Returns the catalog ID for the entity of these permissions.
|
int |
getSourceID()
Returns the entity ID for the entity of these permissions.
|
java.util.Collection<java.lang.String> |
getUserAndRoleNames()
Returns the list of users and roles that currently have some permissions assigned in this permissions block.
|
java.util.Collection<java.lang.String> |
getUserAndRoleNames(boolean childPermissions)
Returns the list of users and roles that currently have some permissions assigned in this permissions block.
|
boolean |
hasChanged()
Returns whether permissions have changed.
|
boolean |
hasPermission(java.lang.String userOrRole,
java.lang.String permission)
Returns whether the given role or user has the specified permission assigned.
|
boolean |
hasPermission(java.lang.String userOrRole,
java.lang.String permission,
boolean childPermissions)
Returns whether the given role or user has the specified permission assigned.
|
void |
removeAllPermissions(java.lang.String userOrRole)
Removes all permissions for the specified role or user.
|
void |
removeAllPermissions(java.lang.String userOrRole,
boolean childPermissions)
Removes all permissions for the specified role or user.
|
void |
removePermission(java.lang.String userOrRole,
java.lang.String permission)
Removes the specified permission for the specified role or user.
|
void |
removePermission(java.lang.String userOrRole,
java.lang.String permission,
boolean childPermissions)
Removes the specified permission for the specified role or user.
|
void |
save()
Saves the current state of permissions for the entity.
|
void |
setUseChildPermissions(boolean value)
In case of a category permissions block this configures whether the configured permissions should be automatically be assigned to newly created sub
categories or whether the new child categories have their own permission block.
|
boolean |
useChildPermissions()
In case of a category permissions block this return value specified whether the configured permissions should be automatically be assigned to newly
created sub categories or whether the new child categories have their own permission block.
|
toXMLString
public void copyFrom(Permissions permissions)
permissions
- the permissions to replace these permissions withpublic int getCatalogID()
public int getSourceID()
public boolean useChildPermissions()
addPermission(String, String, boolean)
public void setUseChildPermissions(boolean value)
value
- set to true if the child categories should have their own permissions blockpublic void addPermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- role name or user UIDpermission
- permission to addpublic void addPermission(java.lang.String userOrRole, java.lang.String permission, boolean childPermissions)
userOrRole
- role name or user UIDpermission
- permission to addchildPermissions
- if set to true this settings belongs to the child categoriespublic void removeAllPermissions(java.lang.String userOrRole)
userOrRole
- role name or user UIDpublic void removeAllPermissions(java.lang.String userOrRole, boolean childPermissions)
userOrRole
- role name or user UIDchildPermissions
- if true the removal is made on the child categories permissions blockpublic void removePermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- role name or user UIDpermission
- the permission to removepublic void removePermission(java.lang.String userOrRole, java.lang.String permission, boolean childPermissions)
userOrRole
- role name or user UIDpermission
- the permission to removechildPermissions
- if true the removal is made on the child categories permissions blockpublic boolean hasPermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- role name or user UIDpermission
- permission to checkpublic boolean hasPermission(java.lang.String userOrRole, java.lang.String permission, boolean childPermissions)
userOrRole
- role name or user UIDpermission
- permission to checkchildPermissions
- if true the check is made on the child categories permissions blockpublic java.util.Collection<java.lang.String> getUserAndRoleNames()
public java.util.Collection<java.lang.String> getUserAndRoleNames(boolean childPermissions)
childPermissions
- if true the work is made on the child categories permissions blockpublic boolean hasChanged()
public void save() throws InvalidStateException, CumulusException
InvalidStateException
- in case of an errorCumulusException
- in case of an errorwww.canto.com
Canto, the Canto logo, the Cumulus logo, and Cumulus are registered trademarks of Canto GmbH, registered in the U.S. and other countries.