com.ibm.pim.organization
Interface Role

All Superinterfaces:
Performer

public interface Role
extends Performer

Role interface. User management in the system is controlled by roles. Privileges are set to roles and users inherit privileges based on the roles assigned to them.

Since:
6.0.0

Nested Class Summary
static class Role.Privilege
          Access Privileges for use with Catalog and Hierarchy objects
 
Field Summary
static java.lang.String copyright
           
 
Method Summary
 void delete()
          Delete this role
 java.util.Collection<AccessControlGroup> getAccessControlGroups()
          Provides a collection of Access Control Groups applicable to this role
 java.util.Collection<AttributeCollection> getAttributeCollectionForPrivilegeType(Catalog catalog, Role.Privilege type)
          Fetches the attribute collections on which the role has the mentioned type of privilege for the given catalog.
 java.util.Collection<AttributeCollection> getAttributeCollectionForPrivilegeType(Hierarchy hierarchy, Role.Privilege type)
          Fetches the attribute collections on which the role has the mentioned type of privilege for the given catalog.
 java.lang.String getDescription()
          The textual description of this role
 java.util.List<java.util.Locale> getLocales()
          The Locales applied to this role
 java.util.List<java.util.Locale> getLocales(Catalog catalog)
          Retrieve the Locales applied to this role for a specific catalog
 java.util.List<java.util.Locale> getLocales(Hierarchy hierarchy)
          Retrieve the Locales applied to this role for a specific hierarchy
 java.lang.String getName()
          The name given to this role
 java.util.Set<Permission> getPermissionList(AccessControlGroup accessControlGroup)
          Fetches the Permissions granted to this role as part of the given access control group.
 java.util.Set<ScreenPrivilege> getScreenPrivileges()
          Fetches the set of screen privileges granted to this user.
 java.util.Set<SystemWideAccessPrivilege> getSystemWideAccessPrivileges()
          Fetches the set of system wide access privileges granted to this user.
 PIMCollection<User> getUsers()
          Identifies the Users applied to the Role
 void grantPermissions(AccessControlGroup accessControlGroup, java.util.Set<Permission> permissions)
          Grants the given set of permissions to this role as part of the given access control group.
 void grantScreenPrivileges(java.util.Set<ScreenPrivilege> privileges)
          Grants the given screen privileges
 void grantSystemWideAccessPrivileges(java.util.Set<SystemWideAccessPrivilege> privileges)
          Grants the given system wide access privileges
 void revokePermissions(AccessControlGroup accessControlGroup, java.util.Set<Permission> permissions)
          Revokes the given set of permissions to this role as part of the given access control group.
 void revokeScreenPrivileges(java.util.Set<ScreenPrivilege> privileges)
          Revokes the given screen privileges
 void revokeSystemWideAccessPrivileges(java.util.Set<SystemWideAccessPrivilege> privileges)
          Revokes the given system wide access privileges
 void save()
          Saves this role information
 void setAttributeCollectionPrivilege(Catalog catalog, Role.Privilege privilege, java.util.Collection<AttributeCollection> collections)
          Sets the privileges for a role on attribute collections for a catalog.
 void setAttributeCollectionPrivilege(Hierarchy hierarchy, Role.Privilege privilege, java.util.Collection<AttributeCollection> collections)
          Sets the privileges for a role on attribute collections for a hierarchy.
 void setLocales(Catalog catalog, java.util.List<java.util.Locale> locales)
          Sets an array of Locales appropriate for this Role and specific catalog.
 void setLocales(Hierarchy hierarchy, java.util.List<java.util.Locale> locales)
          Sets an array of Locales appropriate for this Role and specific hierarchy.
 void setLocales(java.util.List<java.util.Locale> locales)
          Sets an array of Locales appropriate for this Role
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

delete

void delete()
Delete this role

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user is not the user being accessed and the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS

getAccessControlGroups

java.util.Collection<AccessControlGroup> getAccessControlGroups()
Provides a collection of Access Control Groups applicable to this role

Returns:
a Collection of AccessControlGroup objects
Throws:
PIMInternalException - If an internal error occurs

getAttributeCollectionForPrivilegeType

java.util.Collection<AttributeCollection> getAttributeCollectionForPrivilegeType(Catalog catalog,
                                                                                 Role.Privilege type)
Fetches the attribute collections on which the role has the mentioned type of privilege for the given catalog.

Parameters:
catalog - The selected catalog
type - EDIT or VIEW
Returns:
collections AttributeCollections
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If the catalog has not been persisted.

getAttributeCollectionForPrivilegeType

java.util.Collection<AttributeCollection> getAttributeCollectionForPrivilegeType(Hierarchy hierarchy,
                                                                                 Role.Privilege type)
Fetches the attribute collections on which the role has the mentioned type of privilege for the given catalog.

Parameters:
hierarchy - The selected hierarchy
type - EDIT or VIEW
Returns:
Collection of AttributeCollection objects
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If the hierarchy has not been persisted.

getDescription

java.lang.String getDescription()
The textual description of this role

Returns:
a string description
Throws:
PIMInternalException - If an internal error occurs

getLocales

java.util.List<java.util.Locale> getLocales()
The Locales applied to this role

Returns:
a list of Locale objects for this role
Throws:
PIMInternalException - If an internal error occurs

getLocales

java.util.List<java.util.Locale> getLocales(Catalog catalog)
Retrieve the Locales applied to this role for a specific catalog

Parameters:
catalog - The selected catalog
Returns:
a list of Locale objects for this role and catalog
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If catalog object is null
java.lang.IllegalStateException - If the catalog has not been persisted

getLocales

java.util.List<java.util.Locale> getLocales(Hierarchy hierarchy)
Retrieve the Locales applied to this role for a specific hierarchy

Parameters:
hierarchy - The selected hierarchy
Returns:
a list of Locale objects for this role and hierarchy
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If any of the input parameters is null
java.lang.IllegalStateException - If any of the API objects passed as parameter has not been persisted.

getName

java.lang.String getName()
The name given to this role

Returns:
a string name
Throws:
PIMInternalException - If an internal error occurs

getUsers

PIMCollection<User> getUsers()
Identifies the Users applied to the Role

Returns:
a PIMCollection of Users
Throws:
PIMInternalException - If an internal error occurs

save

void save()
Saves this role information

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS

setAttributeCollectionPrivilege

void setAttributeCollectionPrivilege(Catalog catalog,
                                     Role.Privilege privilege,
                                     java.util.Collection<AttributeCollection> collections)
Sets the privileges for a role on attribute collections for a catalog. The privileges are persisted when save is invoked. When this method is invoked, existing edit and view privileges on attribute collections for this role on the given catalog are overwritten. When the role is set both edit and view permission on an attribute collection, the permission last set for the attribute collection is used.

Parameters:
catalog - The selected Catalog
privilege - Edit or View
collections - AttributeCollections
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the API objects passed as a parameter has not been saved.

setAttributeCollectionPrivilege

void setAttributeCollectionPrivilege(Hierarchy hierarchy,
                                     Role.Privilege privilege,
                                     java.util.Collection<AttributeCollection> collections)
Sets the privileges for a role on attribute collections for a hierarchy. The privileges are persisted when save is invoked. When this method is invoked, existing edit and view privileges on attribute collections for this role on the given hierarchy are overwritten. When the role is set both edit and view permission on an attribute collection, the permission last set for the attribute collection is used.

Parameters:
hierarchy - The selected hierarchy
privilege - Edit or View
collections - AttributeCollections
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the API objects passed as a parameter has not been saved.

setLocales

void setLocales(java.util.List<java.util.Locale> locales)
Sets an array of Locales appropriate for this Role

Parameters:
locales - list of locales
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.

setLocales

void setLocales(Catalog catalog,
                java.util.List<java.util.Locale> locales)
Sets an array of Locales appropriate for this Role and specific catalog. Must be a subset of Locales available to the role itself

Parameters:
catalog - The selected catalog
locales - list of locales
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the API objects passed as a parameter has not been saved.

setLocales

void setLocales(Hierarchy hierarchy,
                java.util.List<java.util.Locale> locales)
Sets an array of Locales appropriate for this Role and specific hierarchy. Must be a subset of Locales available to the role itself

Parameters:
hierarchy - The selected hierarchy
locales - list of locales
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the API objects passed as a parameter has not been saved.

grantSystemWideAccessPrivileges

void grantSystemWideAccessPrivileges(java.util.Set<SystemWideAccessPrivilege> privileges)
Grants the given system wide access privileges

Parameters:
privileges - Set of system wide access privileges
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.

revokeSystemWideAccessPrivileges

void revokeSystemWideAccessPrivileges(java.util.Set<SystemWideAccessPrivilege> privileges)
Revokes the given system wide access privileges

Parameters:
privileges - Set of system wide access privileges
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.

getSystemWideAccessPrivileges

java.util.Set<SystemWideAccessPrivilege> getSystemWideAccessPrivileges()
Fetches the set of system wide access privileges granted to this user.

Returns:
Set of system wide access privileges
Throws:
PIMInternalException - If an internal error occurs

getPermissionList

java.util.Set<Permission> getPermissionList(AccessControlGroup accessControlGroup)
Fetches the Permissions granted to this role as part of the given access control group.

Parameters:
accessControlGroup - The access control group corresponding to which permissions have to be fetched.
Returns:
A set of permissions granted to this role under this access control group.
Throws:
PIMInternalException - If an internal error occurs.
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the API object passed as parameter has not been persisted.

grantPermissions

void grantPermissions(AccessControlGroup accessControlGroup,
                      java.util.Set<Permission> permissions)
Grants the given set of permissions to this role as part of the given access control group. Permissions which are not part of this set are not overwritten.

Parameters:
accessControlGroup - The access control group corresponding to which the permissions have to be granted.
permissions - The set of permissions to be granted
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the input parameters has not been persisted.

revokePermissions

void revokePermissions(AccessControlGroup accessControlGroup,
                       java.util.Set<Permission> permissions)
Revokes the given set of permissions to this role as part of the given access control group. Permissions which are not part of this set are not overwritten.

Parameters:
accessControlGroup - The access control group corresponding to which the permissions have to be granted.
permissions - The set of permissions to be granted
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.
java.lang.IllegalStateException - If any of the input parameters has not been persisted.

getScreenPrivileges

java.util.Set<ScreenPrivilege> getScreenPrivileges()
Fetches the set of screen privileges granted to this user.

Returns:
Set of screen privileges
Throws:
PIMInternalException - If an internal error occurs

grantScreenPrivileges

void grantScreenPrivileges(java.util.Set<ScreenPrivilege> privileges)
Grants the given screen privileges

Parameters:
privileges - Set of screen privileges
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.

revokeScreenPrivileges

void revokeScreenPrivileges(java.util.Set<ScreenPrivilege> privileges)
Revokes the given screen privileges

Parameters:
privileges - Set of screen privileges
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters is null.