|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GlobalPermissionManager
Use this manager to add/remove or check the following global permissions.
Global permissions are:
Permissions.SYSTEM_ADMIN
Permissions.ADMINISTER
Permissions.USE
Permissions.USER_PICKER
Permissions.CREATE_SHARED_OBJECTS
Permissions.MANAGE_GROUP_FILTER_SUBSCRIPTIONS
Permissions.BULK_CHANGE
PermissionManager
.
To check programmatically if a permission is global use Permissions.isGlobalPermission(int)
.
Method Summary | |
---|---|
boolean |
addPermission(int permissionType,
String group)
Grants a user group a global permission. |
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 permissionType)
Check if a global permission is granted for an anonymous user. |
boolean |
hasPermission(int permissionType,
com.atlassian.crowd.embedded.api.User u)
Check if a global permission for one of the users groups exists. |
boolean |
removePermission(int permissionType,
String group)
Revokes a global permission for a user group |
boolean |
removePermissions(String group)
Revoke all global permissions for a user group. |
Method Detail |
---|
boolean addPermission(int permissionType, String group) throws CreateException
permissionType
- the global permission.group
- the name of the group. Null means "anyone" group.
The JIRA use permission cannot be granted to anyone.
CreateException
- if the permission creation failsCollection<JiraPermission> getPermissions(int permissionType)
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.
permissionType
- The permission. Must be a global permission.
JiraPermission.getPermType()
, must never return null.boolean removePermission(int permissionType, String group) throws RemoveException
permissionType
- the global permission.group
- the group name. NULL means the anyone group.
RemoveException
- if the permission removal failsboolean removePermissions(String group) throws RemoveException
group
- cannot NOT be null and the group must exist.
RemoveException
- if the permission removal failsboolean hasPermission(int permissionType)
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 hasPermission(int, User)
method is you have the user object,
i.e. user is not 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.
permissionType
- must be global permission
hasPermission(int, User)
boolean hasPermission(int permissionType, com.atlassian.crowd.embedded.api.User u)
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 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.
permissionType
- must be a global permissionu
- must not be null
hasPermission(int)
,
PermissionManager.hasPermission(int, User)
Collection<com.atlassian.crowd.embedded.api.Group> getGroupsWithPermission(int permissionId)
permissionId
- must be a global permission
Group
's, will never be null.Collection<String> getGroupNames(int permissionId)
permissionId
- must be a global permission
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |