public class PermissionTemplate extends BaseManager implements Item
BaseManager.PackEntryChangeListener, BaseManager.RegistryEntry
TYPE_EJP, TYPE_NATIVE
Modifier and Type | Method and Description |
---|---|
void |
addPermission(java.lang.String userOrRole,
java.lang.String permission)
Adds the specified positive permission for the specified user or role.
|
void |
addPermissionRemoval(java.lang.String userOrRole,
java.lang.String permission)
Adds the specified negative permission for the specified user or role.
|
JPack |
exportSet()
Exports this set into a
JPack . |
java.lang.String |
getDescription(int languageID)
Returns the description for the given language id.
|
java.lang.String |
getDisplayName(int languageID,
boolean fallbackToDefaultName)
Returns the display name for the given language id.
|
java.lang.String |
getID()
Returns the UID of the item in the items namespace.
|
boolean |
getIsDefault()
Returns whether this is the default permission template.
|
java.lang.String |
getName()
Returns the name of this permission template.
|
JPack |
getPack()
Internal function
|
java.util.Collection<java.lang.String> |
getPermissionRemovals(java.lang.String userOrRole)
Returns a collection of all negative permissions for the given user or role.
|
java.util.Collection<java.lang.String> |
getPermissions(java.lang.String userOrRole)
Returns a collection of all positive permissions for the given user or role.
|
PermissionsListTables |
getPermissionsListTables()
Return the table-specific permission template configuration that overwrite the generic information.
|
RestrictionsList |
getRestrictionsList()
Returns the list of roles and users that are allowed to view this set.
|
java.util.Collection<java.lang.String> |
getUserAndRoleNames()
Returns a collection of all uer UIDs and role names known to this template.
|
boolean |
hasPermission(java.lang.String userOrRole,
java.lang.String permission)
Returns whether the given user or role has the specified positive permission.
|
boolean |
hasPermissionRemoval(java.lang.String userOrRole,
java.lang.String permission)
Returns whether the given user or role has the specified negative permission.
|
boolean |
isDefault()
Returns whether this item is the default item.
|
boolean |
isSharingRestricted()
Returns whether the set visibility is restricted to a group of users or roles.
|
void |
removePermission(java.lang.String userOrRole,
java.lang.String permission)
Removes the specified positive permission for the specified user or role.
|
void |
removePermissionRemoval(java.lang.String userOrRole,
java.lang.String permission)
Removes the specified negative permission for the specified user or role.
|
void |
removeUserOrRole(java.lang.String userOrRole)
Removes the user or role including all assigned permissions.
|
void |
setDescription(int languageID,
java.lang.String description)
Sets the description for the given language.
|
void |
setDisplayName(int languageID,
java.lang.String displayName)
Sets the display name for the given language.
|
void |
setSharingRestricted(boolean value)
Sets whether the set visibility is restricted to a group of users or roles.
|
addChangeListener, addChangeListener, addGlobalChangeListener, addPackListener, forgetPush, isShared, popPack, pushPack, removeChangeListener, removeChangeListener, removeGlobalChangeListener, removePackListener, save, save, toString, writeAsXML
public java.lang.String getName()
public boolean getIsDefault()
public void addPermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UID to add the permission forpermission
- the permission to addpublic void addPermissionRemoval(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UID to add the permission forpermission
- the permission to add as a negative permissionpublic void removeUserOrRole(java.lang.String userOrRole)
userOrRole
- the role name or user UID to removepublic void removePermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UID to remove the permission frompermission
- the permission to removepublic void removePermissionRemoval(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UID to remove the permission frompermission
- the permission to remove as a negative permissionpublic boolean hasPermission(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UIDpermission
- permission namepublic boolean hasPermissionRemoval(java.lang.String userOrRole, java.lang.String permission)
userOrRole
- the role name or user UIDpermission
- permission namepublic PermissionsListTables getPermissionsListTables()
public java.util.Collection<java.lang.String> getPermissions(java.lang.String userOrRole)
userOrRole
- the role name or user UID to get all positive permissions forString
permissionspublic java.util.Collection<java.lang.String> getPermissionRemovals(java.lang.String userOrRole)
userOrRole
- the role name or user UID to get all negative permissions forString
permissionspublic java.util.Collection<java.lang.String> getUserAndRoleNames()
public JPack exportSet()
JPack
.exportSet
in interface Item
JPack
PermissionTemplatesList.importSet(com.canto.cumulus.utils.JPack, SetImportDuplicatesMode)
public JPack getPack()
getPack
in class BaseManager
public java.lang.String getID()
Item
public boolean isDefault()
Item
public java.lang.String getDescription(int languageID)
getDescription
in interface Item
languageID
- specifying the language for the descriptionpublic void setDescription(int languageID, java.lang.String description)
setDescription
in interface Item
languageID
- the language to set the description fordescription
- the new descriptionpublic java.lang.String getDisplayName(int languageID, boolean fallbackToDefaultName)
getDisplayName
in interface Item
languageID
- specifying the language for the display namefallbackToDefaultName
- when set to true this method returns the default name when now localized display name is available otherwise nullpublic void setDisplayName(int languageID, java.lang.String displayName)
setDisplayName
in interface Item
languageID
- the language to set the display name fordisplayName
- the new display namepublic boolean isSharingRestricted()
isSharingRestricted
in interface Item
public void setSharingRestricted(boolean value)
setSharingRestricted
in interface Item
value
- set to true if the set visibility should be restricted to a group of users or rolespublic RestrictionsList getRestrictionsList()
isSharingRestricted()
returns
true.getRestrictionsList
in interface Item
www.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.