|
||||||||||
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 global permissions.
The system global permissions are:
GlobalPermissionType.SYSTEM_ADMIN
GlobalPermissionType.ADMINISTER
GlobalPermissionType.USE
GlobalPermissionType.USER_PICKER
GlobalPermissionType.CREATE_SHARED_OBJECTS
GlobalPermissionType.MANAGE_GROUP_FILTER_SUBSCRIPTIONS
GlobalPermissionType.BULK_CHANGE
getAllGlobalPermissions()
in order to get the collection of all global permissions, which includes
plugin global permissions.
For all other project specific permissions use PermissionManager
.
To check programmatically if a permission is global use isGlobalPermission(int)
.
Method Summary | |
---|---|
boolean |
addPermission(GlobalPermissionType globalPermissionType,
String group)
Grants a user group a global permission. |
boolean |
addPermission(int permissionType,
String group)
Deprecated. Use addPermission(com.atlassian.jira.permission.GlobalPermissionType, String) instead. |
void |
clearCache()
|
Collection<GlobalPermissionType> |
getAllGlobalPermissions()
|
com.atlassian.fugue.Option<GlobalPermissionType> |
getGlobalPermission(int permissionId)
Deprecated. use getGlobalPermission(String)
to get global permission by key. Eventually, we want to stop referring to Global Permission's by ID. |
com.atlassian.fugue.Option<GlobalPermissionType> |
getGlobalPermission(String permissionKey)
|
Collection<String> |
getGroupNames(GlobalPermissionType globalPermissionType)
Retrieve all the group names with this permission. |
Collection<String> |
getGroupNames(int permissionId)
Deprecated. Use getGroupNames(com.atlassian.jira.permission.GlobalPermissionType) |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroupsWithPermission(GlobalPermissionType globalPermissionType)
Retrieve all the groups with this permission. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroupsWithPermission(int permissionId)
Deprecated. Use getGroupsWithPermission(com.atlassian.jira.permission.GlobalPermissionType) |
Collection<GlobalPermissionEntry> |
getPermissions(GlobalPermissionType globalPermissionType)
Retrieve a list of user groups which have been granted a specified permission. |
Collection<JiraPermission> |
getPermissions(int permissionType)
Deprecated. Use getPermissions(com.atlassian.jira.permission.GlobalPermissionType) instead. |
boolean |
hasPermission(GlobalPermissionType globalPermissionType)
Check if a global permission is granted for an anonymous user. |
boolean |
hasPermission(GlobalPermissionType globalPermissionType,
ApplicationUser user)
Check if a pluggable global permission for one of the users groups exists. |
boolean |
hasPermission(int permissionType)
Deprecated. Use hasPermission(com.atlassian.jira.permission.GlobalPermissionType) instead. |
boolean |
hasPermission(int permissionType,
ApplicationUser user)
Deprecated. Use hasPermission(com.atlassian.jira.permission.GlobalPermissionType, com.atlassian.jira.user.ApplicationUser) instead. |
boolean |
hasPermission(int permissionType,
com.atlassian.crowd.embedded.api.User user)
Deprecated. Use hasPermission(com.atlassian.jira.permission.GlobalPermissionType, com.atlassian.jira.user.ApplicationUser) instead. |
boolean |
isGlobalPermission(int permissionId)
|
boolean |
removePermission(GlobalPermissionType globalPermissionType,
String group)
Revokes a global permission for a user group |
boolean |
removePermission(int permissionType,
String group)
Deprecated. Use removePermission(com.atlassian.jira.permission.GlobalPermissionType, String) instead. |
boolean |
removePermissions(String group)
Revoke all global permissions for a user group. |
Method Detail |
---|
@ExperimentalApi Collection<GlobalPermissionType> getAllGlobalPermissions()
@ExperimentalApi com.atlassian.fugue.Option<GlobalPermissionType> getGlobalPermission(int permissionId)
getGlobalPermission(String)
to get global permission by key. Eventually, we want to stop referring to Global Permission's by ID.
permissionId
- id of the permission.
@ExperimentalApi com.atlassian.fugue.Option<GlobalPermissionType> getGlobalPermission(@NotNull String permissionKey)
permissionKey
- the key of the permission declared by global permission module.
boolean addPermission(int permissionType, String group)
addPermission(com.atlassian.jira.permission.GlobalPermissionType, String)
instead.
permissionType
- the global permission id.group
- the name of the group. Null means "anyone" group.
The JIRA use, admin and sysadmin permission cannot be granted to anyone.
@ExperimentalApi boolean addPermission(GlobalPermissionType globalPermissionType, String group)
globalPermissionType
- global permission, must not be null.group
- the name of the group. Null means "anyone" group.
The JIRA use, admin and sysadmin permission cannot be granted to anyone.
Collection<JiraPermission> getPermissions(int permissionType)
getPermissions(com.atlassian.jira.permission.GlobalPermissionType)
instead.
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 key of pluggable global permission. Must be a global permission.
JiraPermission.getPermType()
, must never return null.@ExperimentalApi Collection<GlobalPermissionEntry> getPermissions(GlobalPermissionType globalPermissionType)
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.
globalPermissionType
- global permission, must not be null.
JiraPermission.getPermType()
, must never return null.boolean removePermission(int permissionType, String group)
removePermission(com.atlassian.jira.permission.GlobalPermissionType, String)
instead.
permissionType
- the global permission.group
- the group name. NULL means the anyone group.
@ExperimentalApi boolean removePermission(GlobalPermissionType globalPermissionType, String group)
globalPermissionType
- global permission, must not be null.group
- the group name. NULL means the anyone group.
boolean removePermissions(String group)
group
- cannot NOT be null and the group must exist.
boolean hasPermission(int permissionType)
hasPermission(com.atlassian.jira.permission.GlobalPermissionType)
instead.
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)
@ExperimentalApi boolean hasPermission(@NotNull GlobalPermissionType globalPermissionType)
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(com.atlassian.jira.permission.GlobalPermissionType, com.atlassian.jira.user.ApplicationUser)
method is you have the user object,
i.e. user is not anonymous.
Use getGlobalPermission(String)
or getGlobalPermission(int)
in order to get the global
permission using the permission key or id.
globalPermissionType
- global permission, must not be null.
hasPermission(com.atlassian.jira.permission.GlobalPermissionType, ApplicationUser)
boolean hasPermission(int permissionType, com.atlassian.crowd.embedded.api.User user)
hasPermission(com.atlassian.jira.permission.GlobalPermissionType, com.atlassian.jira.user.ApplicationUser)
instead.
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 permissionuser
- must not be null
hasPermission(int)
,
PermissionManager.hasPermission(int, User)
boolean hasPermission(int permissionType, ApplicationUser user)
hasPermission(com.atlassian.jira.permission.GlobalPermissionType, com.atlassian.jira.user.ApplicationUser)
instead.
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 permissionuser
- must not be null
hasPermission(int)
,
PermissionManager.hasPermission(int, User)
@ExperimentalApi boolean hasPermission(@NotNull GlobalPermissionType globalPermissionType, @NotNull ApplicationUser user)
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(com.atlassian.jira.permission.GlobalPermissionType)
method is you do not have the user object, i.e. user is anonymous.
globalPermissionType
- global permission, must not be null.user
- must not be null.
hasPermission(com.atlassian.jira.permission.GlobalPermissionType)
Collection<com.atlassian.crowd.embedded.api.Group> getGroupsWithPermission(int permissionId)
getGroupsWithPermission(com.atlassian.jira.permission.GlobalPermissionType)
permissionId
- must be a global permission
Group
's, will never be null.@ExperimentalApi Collection<com.atlassian.crowd.embedded.api.Group> getGroupsWithPermission(@NotNull GlobalPermissionType globalPermissionType)
globalPermissionType
- global permission, must not be null.
Group
's, will never be null.Collection<String> getGroupNames(int permissionId)
getGroupNames(com.atlassian.jira.permission.GlobalPermissionType)
permissionId
- must be a global permission
@ExperimentalApi Collection<String> getGroupNames(@NotNull GlobalPermissionType globalPermissionType)
globalPermissionType
- global permission, must not be null.
@ExperimentalApi boolean isGlobalPermission(int permissionId)
permissionId
- id of the permission to check.
@Internal void clearCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |