|
||||||||||
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.crowd.embedded.api.CrowdService crowdService,
OfBizDelegator ofBizDelegator,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
boolean |
addPermission(int permissionId,
String group)
Adds a global permission |
Map<Integer,Permission> |
getGlobalPermissions()
Return map of all global permissions. |
Collection<String> |
getGroupNames(int permissionId)
Retrieve all the group names 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 a list of user groups which have been granted a specified permission. |
boolean |
hasPermission(int permissionId)
Check if a global anonymous permission exists |
boolean |
hasPermission(int permissionId,
ApplicationUser user)
Check if a global permission for one of the users groups exists. |
boolean |
hasPermission(int permissionId,
com.atlassian.crowd.embedded.api.User user)
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)
Revokes a global permission for a user group |
boolean |
removePermissions(String group)
Revoke all global permissions for a user group. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultGlobalPermissionManager(com.atlassian.crowd.embedded.api.CrowdService crowdService, OfBizDelegator ofBizDelegator, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
@EventListener public void onClearCache(ClearCacheEvent event)
public Map<Integer,Permission> getGlobalPermissions()
GlobalPermissionManager
getGlobalPermissions
in interface GlobalPermissionManager
public boolean addPermission(int permissionId, String group)
addPermission
in interface GlobalPermissionManager
permissionId
- must be a global permission typegroup
- can be null if it is anyone permission
public Collection<JiraPermission> getPermissions(int permissionType)
GlobalPermissionManager
JiraPermission
contains a reference to the user group.
JiraPermission.getScheme()
is always NULL, because Global permission are not configured using schemes.
JiraPermission.getType()
will always return "group", because global permissions can only be granted to groups.
getPermissions
in interface GlobalPermissionManager
permissionType
- The permission. Must be a global permission.
JiraPermission.getPermType()
, must never return null.public boolean removePermission(int permissionId, String group)
GlobalPermissionManager
removePermission
in interface GlobalPermissionManager
permissionId
- the global permission.group
- the group name. NULL means the anyone group.
public boolean removePermissions(String group)
GlobalPermissionManager
removePermissions
in interface GlobalPermissionManager
group
- cannot NOT be null and the group must exist.
public boolean hasPermission(int permissionId)
hasPermission
in interface GlobalPermissionManager
permissionId
- must be global permission
GlobalPermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionId, com.atlassian.crowd.embedded.api.User user)
GlobalPermissionManager
Permissions.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 GlobalPermissionManager
permissionId
- must be a global permissionuser
- must not be null
GlobalPermissionManager.hasPermission(int)
,
PermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionId, ApplicationUser user)
GlobalPermissionManager
Permissions.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 GlobalPermissionManager
permissionId
- must be a global permissionuser
- must not be null
GlobalPermissionManager.hasPermission(int)
,
PermissionManager.hasPermission(int, User)
public Collection<com.atlassian.crowd.embedded.api.Group> getGroupsWithPermission(int permissionId)
GlobalPermissionManager
getGroupsWithPermission
in interface GlobalPermissionManager
permissionId
- must be a global permission
Group
's, will never be null.public Collection<String> getGroupNames(int permissionId)
GlobalPermissionManager
getGroupNames
in interface GlobalPermissionManager
permissionId
- must be a global permission
protected boolean hasPermission(JiraPermission jiraPermission)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |