public class PermissionManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SOURCE_TYPE_CATALOG |
static int |
SOURCE_TYPE_CATEGORY |
static int |
SOURCE_TYPE_ITEM |
static int |
SOURCE_TYPE_RECORD |
static java.lang.String |
UUID_CURRENT_USER
Static key for the Current User.
|
Modifier and Type | Method and Description |
---|---|
void |
applyPermissionTemplate(CategoryItem categoryItem,
PermissionTemplate permissionTemplate)
Applies the given permission template on to the given category.
|
void |
applyPermissionTemplate(Item item,
PermissionTemplate permissionTemplate)
Applies the given permission template on to the given record.
|
User |
getCurrentUserTemplate()
Returns a descriptor for the 'Current User' which is a placeholder for permission template where this user will be replaced by the user applying the
template.
|
static PermissionManager |
getInstance(Server server)
Returns a permission manager singleton instance for the given server connection.
|
Permissions |
getPermissions(Item item)
Returns the permissions for the given record item.
|
PermissionsList |
getPermissionsList(Item item)
Returns a permissions list containing only the permissions for the specified record item.
|
PermissionsList |
getPermissionsList(ItemCollection itemCollection,
java.util.Set<ItemIdentifier> idList)
Returns a permissions list for a number of records.
|
PermissionsList |
getPermissionsList(MultiItemCollection multiItemCollection,
java.util.Set<ItemIdentifier> idList)
Returns a permissions list for a number of records.
|
PermissionsList |
getPermissionsList(java.lang.String tableName,
java.util.Set<ItemIdentifier> idList)
Returns a permissions list for a number of records.
|
Roles |
getRoles()
Returns the list of roles available at the server.
|
Server |
getServer()
Returns the server of this instance.
|
User |
getUserByLoginName(java.lang.String loginName)
Returns a user by his login name.
|
Users |
getUsers(java.lang.String match)
Returns a list of users that match the given query string.
|
Users |
getUsers(java.lang.String match,
boolean activeUsersOnly)
Returns a list of users that match the given query string.
|
boolean |
isAdvancedMode()
Returns whether the Cumulus user management runs in advanced mode using roles.
|
public static final int SOURCE_TYPE_RECORD
public static final int SOURCE_TYPE_CATEGORY
public static final int SOURCE_TYPE_CATALOG
public static final int SOURCE_TYPE_ITEM
public static final java.lang.String UUID_CURRENT_USER
public Server getServer()
public static PermissionManager getInstance(Server server)
server
- server to work withpublic User getCurrentUserTemplate()
public Roles getRoles() throws CumulusException
CumulusException
- in case of an errorpublic Users getUsers(java.lang.String match) throws CumulusException
match
- the query against a user name must matchCumulusException
- in case of an errorpublic Users getUsers(java.lang.String match, boolean activeUsersOnly) throws CumulusException
match
- the query against a user name must matchCumulusException
- in case of an errorpublic User getUserByLoginName(java.lang.String loginName) throws CumulusException
loginName
- the users login namCumulusException
- in case of an errorpublic boolean isAdvancedMode()
public Permissions getPermissions(Item item) throws InvalidStateException, CumulusException
item
- the item to get the permissions forInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic PermissionsList getPermissionsList(Item item) throws InvalidStateException, CumulusException
item
- The item to get the permissions forInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic PermissionsList getPermissionsList(ItemCollection itemCollection, java.util.Set<ItemIdentifier> idList) throws InvalidStateException, CumulusException
itemCollection
- The item collection that contains the itemsidList
- The identifiers of the items to get the permissions forInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic PermissionsList getPermissionsList(MultiItemCollection multiItemCollection, java.util.Set<ItemIdentifier> idList) throws InvalidStateException, CumulusException
multiItemCollection
- The multiple item collection that contains the itemsidList
- The identifiers of the items to get the permissions forInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic PermissionsList getPermissionsList(java.lang.String tableName, java.util.Set<ItemIdentifier> idList) throws InvalidStateException, CumulusException
tableName
- The name of the table that the items come from. For record items this is Cumulus.TABLE_NAME_ASSET_RECORDS
and for category items
it is Cumulus.TABLE_NAME_CATEGORIES
.idList
- The identifiers of the record items to get the permissionsInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic void applyPermissionTemplate(Item item, PermissionTemplate permissionTemplate) throws InvalidStateException, CumulusException
item
- the item to apply the template topermissionTemplate
- the template to applyInvalidStateException
- in case of an errorCumulusException
- in case of an errorpublic void applyPermissionTemplate(CategoryItem categoryItem, PermissionTemplate permissionTemplate) throws InvalidStateException, CumulusException
categoryItem
- the category to apply the template topermissionTemplate
- the template to applyInvalidStateException
- 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.