com.polarion.platform.security.ISecurityService


METHODS
Modifiers and TypeNameDescription
String getCurrentUser() Shortcut for getSubjectUser(getCurrentSubject())
Collection getGlobalRoles()
void createGlobalRole(String) Creates a global role. Does nothing if the role already exists.
void removeGlobalRole(String) Removes the global role. Does nothing, if no such role exists.

Roles 'admin' and 'user' can't be removed. The method is returned without doing any action in such cases.

Collection getContextRoles(IContextId)
void createContextRole(String,IContextId) Creates a context role. Does nothing if the role already exists.

The context role will exist in the given context and the whole context tree below.

void removeContextRole(String,IContextId) Removes a global role. Does nothing, if no such role exists.

Note: The existence of a context role might be inherited from the parent context. If so then the deletion in the current context might have no impact.

Collection getUsersForGlobalRole(String) Returns the IDs of all users, that do have the given role.
Collection getUsersForContextRole(String,IContextId) Returns the IDs of all users, that have the given role for the given context. (Project or Global level roles.)
Map getContextRoleAssignmentsForUser(String,IContextId) Returns the context roles assigned to the specific User together with the source of the assignment. WARNING: If you are not interested in the sources, use {@link #getContextRolesForUser} instead for better performance.
Collection getUsersWithContextRole(IContextId) Returns the IDs of all users, that have some role in the given context.
void addGlobalRoleToUser(String,String)
void removeGlobalRoleFromUser(String,String)
void addContextRoleToUser(String,String,IContextId)
void removeContextRoleFromUser(String,String,IContextId)
Collection getRolesForUser(String) Returns all global roles assigned to the given user.
Collection getRolesForUser(String,IContextId) Returns all global + context roles assigned to the user.
Collection getContextRolesForUser(String,IContextId) Returns the context roles assigned to the user.
Map getRolesForUser(String,IContextId) Returns all global + context roles assigned to the user for specified contexts.
Map getContextRolesForUser(String,IContextId) Returns context roles assigned to the user for specified contexts.
IUserManagementPolicy getUserManagementPolicy()
boolean hasAddonLicense(String) Checks whether the current user has a license for a specific add-on.

Back to Index