|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.security.DefaultGlobalPermissionManager
public class DefaultGlobalPermissionManager
| Constructor Summary | |
|---|---|
DefaultGlobalPermissionManager(com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.crowd.embedded.api.CrowdService crowdService)
|
|
| Method Summary | |
|---|---|
boolean |
addPermission(int permissionId,
String group)
Adds a global permission |
Collection<String> |
getGroupNames(int permissionId)
Retrieve all the group names with this permission. |
Collection<Group> |
getGroups(int permissionId)
Retrieve all the groups with this permission |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroupsWithPermission(int permissionId)
Retrieve all the groups with this permission. |
Collection<JiraPermission> |
getPermissions(int permissionType)
Retrieve all the global permissions of a particular type |
boolean |
hasPermission(int permissionId)
Check if a global anonymous permission exists |
boolean |
hasPermission(int permissionId,
com.atlassian.crowd.embedded.api.User u)
Check if a global permission for one of the users groups exists |
boolean |
hasPermission(int permissionType,
User u)
Check if a global permission for one of the users groups exists. |
protected boolean |
hasPermission(JiraPermission jiraPermission)
|
void |
onClearCache(ClearCacheEvent event)
|
boolean |
removePermission(int permissionId,
String group)
Removes a global permission |
boolean |
removePermissions(String group)
Remove a global permissions that the group passed in |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultGlobalPermissionManager(com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.crowd.embedded.api.CrowdService crowdService)
| Method Detail |
|---|
public void start()
throws Exception
Startable
start in interface StartableException - Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public boolean addPermission(int permissionId,
String group)
throws CreateException
addPermission in interface GlobalPermissionManagerpermissionId - must be a global permission typegroup - can be null if it is anyone permission
CreateExceptionpublic Collection<JiraPermission> getPermissions(int permissionType)
GlobalPermissionManager
getPermissions in interface GlobalPermissionManagerpermissionType - must be a global permission
JiraPermission, must never return null
public boolean removePermission(int permissionId,
String group)
throws RemoveException
removePermission in interface GlobalPermissionManagerpermissionId - must be a global permission typegroup - can be null if it is anyone permission
RemoveException
public boolean removePermissions(String group)
throws RemoveException
removePermissions in interface GlobalPermissionManagergroup - must NOT be null and the group must exist
RemoveException - if the permission removal failspublic boolean hasPermission(int permissionId)
hasPermission in interface GlobalPermissionManagerpermissionId - must be global permission
GlobalPermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionId,
com.atlassian.crowd.embedded.api.User u)
hasPermission in interface GlobalPermissionManagerpermissionId - must be a global permissionu - must not be null
GlobalPermissionManager.hasPermission(int),
PermissionManager.hasPermission(int, User)public Collection<Group> getGroups(int permissionId)
getGroups in interface GlobalPermissionManagerpermissionId - must be a global permission
public Collection<com.atlassian.crowd.embedded.api.Group> getGroupsWithPermission(int permissionId)
GlobalPermissionManager
getGroupsWithPermission in interface GlobalPermissionManagerpermissionId - must be a global permission
Group's, will never be null.public Collection<String> getGroupNames(int permissionId)
GlobalPermissionManager
getGroupNames in interface GlobalPermissionManagerpermissionId - must be a global permission
protected boolean hasPermission(JiraPermission jiraPermission)
public boolean hasPermission(int permissionType,
User u)
GlobalPermissionManagerPermissions.ADMINISTER and the lookup is false then the same
query will be executed for the Permissions.SYSTEM_ADMIN permission type, since
it is implied that having a Permissions.SYSTEM_ADMIN permission grants
Permissions.ADMINISTER rights.
Note: Use GlobalPermissionManager.hasPermission(int) method is you do not have the user object, i.e. user is anonymous.
If you are using this method directly, consider using
PermissionManager.hasPermission(int, User)
instead as it handles logged in and anonymous users as well.
hasPermission in interface GlobalPermissionManagerpermissionType - must be a global permissionu - must not be null
GlobalPermissionManager.hasPermission(int),
PermissionManager.hasPermission(int, User)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||