public interface PermissionAdminService
PermissionService
Modifier and Type | Method and Description |
---|---|
void |
canAddUserToGroup(String group)
Check if the current user can add users to the given group.
|
void |
canDeleteGroup(String group)
Check if the current user can delete a group without affecting their permissions
|
void |
canDeleteUser(String userName)
Check if the
normal user can be deleted. |
void |
canRemoveUserFromGroup(String username,
String group)
Check if a
normal user can remove themselves from the given group. |
Page<PermittedGroup> |
findGroupsWithGlobalPermission(String filter,
PageRequest pageRequest)
Retrieves a page of
groups and their highest global permission. |
Page<String> |
findGroupsWithoutGlobalPermission(String filter,
PageRequest pageRequest)
Retrieves a page of groups who have not been explicitly granted any global permission
|
Page<String> |
findGroupsWithoutProjectPermission(Project project,
String filter,
PageRequest pageRequest)
Retrieves a page of groups who have not been explicitly granted any project permission
|
Page<String> |
findGroupsWithoutRepositoryPermission(Repository repository,
String filter,
PageRequest pageRequest)
Retrieves a page of groups who have not been explicitly granted any repository permission.
|
Page<PermittedGroup> |
findGroupsWithProjectPermission(Project project,
String filter,
PageRequest pageRequest)
Retrieves a page of
groups and their highest granted permission for the specified project. |
Page<PermittedGroup> |
findGroupsWithRepositoryPermission(Repository repository,
String filter,
PageRequest pageRequest)
Retrieves a page of
groups and their highest granted permission for the specified
repository. |
Page<ApplicationUser> |
findLicensedUsersWithoutProjectPermission(Project project,
String filter,
PageRequest pageRequest)
|
Page<ApplicationUser> |
findLicensedUsersWithoutRepositoryPermission(Repository repository,
String filter,
PageRequest pageRequest)
|
Page<PermittedUser> |
findUsersWithGlobalPermission(String filter,
PageRequest pageRequest)
Retrieves a page of
users and their highest global permission. |
Page<ApplicationUser> |
findUsersWithoutGlobalPermission(String filter,
PageRequest pageRequest)
Retrieves a page of
active users who have not been explicitly
granted any global permission |
Page<PermittedUser> |
findUsersWithProjectPermission(Project project,
String filter,
PageRequest pageRequest)
Retrieves a page of
users and their highest granted permission for the specified project. |
Page<PermittedUser> |
findUsersWithRepositoryPermission(Repository repository,
String filter,
PageRequest pageRequest)
Retrieves a page of
users and their highest granted permission for the specified
repository. |
void |
grantAllProjectPermission(Permission permission,
Project project)
Grant a project permission to all users users
|
boolean |
hasAllProjectPermission(Permission permission,
Project project)
Check if the given project permission has been granted to every logged in user for the given project.
|
void |
revokeAllGlobalPermissions(ApplicationUser user)
Revoke all global permissions for the given user.
|
void |
revokeAllGlobalPermissions(String group)
Revoke all global permissions for the given group.
|
void |
revokeAllGroupPermissions(String name)
Revoke all permissions granted to a group.
|
void |
revokeAllProjectPermission(Permission permission,
Project project)
Revoked a project permission from all users users
|
void |
revokeAllProjectPermissions(Project project,
ApplicationUser user)
Revoke all project permissions for the given user.
|
void |
revokeAllProjectPermissions(Project project,
String group)
Revoke all project permissions for the given group.
|
void |
revokeAllRepositoryPermissions(Repository repository,
ApplicationUser user)
Revoke all repository permissions for the given user.
|
void |
revokeAllRepositoryPermissions(Repository repository,
String group)
Revoke all repository permissions for the given group.
|
void |
revokeAllUserPermissions(ApplicationUser user)
Revoke all permissions from a user.
|
void |
revokeAllUserPermissions(String name)
Revoke all permissions from a
normal user. |
void |
setPermission(SetPermissionRequest request)
Assigns a permission to multiple users and/or groups.
|
void canRemoveUserFromGroup(@Nonnull String username, @Nonnull String group)
normal
user can remove themselves from the given group.username
- the user to checkgroup
- the group from which the user is to be removed.void canAddUserToGroup(@Nonnull String group)
group
- the group to which users will be added.void canDeleteGroup(@Nonnull String group)
group
- the group to be deleted.void canDeleteUser(@Nonnull String userName)
normal
user can be deleted.userName
- the name of the user being deleted@Nonnull Page<PermittedGroup> findGroupsWithGlobalPermission(@Nullable String filter, @Nonnull PageRequest pageRequest)
groups
and their highest global permission. Groups which do not have any global permissions
explicitly assigned to them will not be returned.filter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<String> findGroupsWithoutGlobalPermission(@Nullable String filter, @Nonnull PageRequest pageRequest)
filter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<String> findGroupsWithoutProjectPermission(@Nonnull Project project, @Nullable String filter, @Nonnull PageRequest pageRequest)
project
- the project for which the permissions are required.filter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<String> findGroupsWithoutRepositoryPermission(@Nonnull Repository repository, @Nullable String filter, @Nonnull PageRequest pageRequest)
repository
- the repository for which the permissions are required.filter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<PermittedGroup> findGroupsWithProjectPermission(@Nonnull Project project, @Nullable String filter, @Nonnull PageRequest pageRequest)
groups
and their highest granted permission for the specified project.
Groups which do not have any permissions explicitly assigned to them for the specified
project will not be returned.project
- the project for which permissions should be consideredfilter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<PermittedGroup> findGroupsWithRepositoryPermission(@Nonnull Repository repository, @Nullable String filter, @Nonnull PageRequest pageRequest)
groups
and their highest granted permission for the specified
repository. Groups which do not have any permissions explicitly assigned to them for the specified
repository will not be returned.repository
- the repository for which permissions should be consideredfilter
- if non-null non-empty then the groups returned must include this textpageRequest
- bounds the page of groups to be returned@Nonnull Page<ApplicationUser> findLicensedUsersWithoutProjectPermission(@Nonnull Project project, @Nullable String filter, @Nonnull PageRequest pageRequest)
active
and licensed
users who
have not been explicitly granted any project permissionproject
- the project for which the permissions are required.filter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returned@Nonnull Page<ApplicationUser> findLicensedUsersWithoutRepositoryPermission(@Nonnull Repository repository, @Nullable String filter, @Nonnull PageRequest pageRequest)
active
and licensed
users who
have not been explicitly granted any repository permission.repository
- the repository for which the permissions are required.filter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returned@Nonnull Page<PermittedUser> findUsersWithGlobalPermission(@Nullable String filter, @Nonnull PageRequest pageRequest)
users
and their highest global permission. Users which do not have any
global permissions explicitly assigned to them will not be returned.filter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returned@Nonnull Page<ApplicationUser> findUsersWithoutGlobalPermission(@Nullable String filter, @Nonnull PageRequest pageRequest)
active
users who have not been explicitly
granted any global permissionfilter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returned@Nonnull Page<PermittedUser> findUsersWithProjectPermission(@Nonnull Project project, @Nullable String filter, @Nonnull PageRequest pageRequest)
users
and their highest granted permission for the specified project. Users
which do not have any permissions explicitly assigned to them for the specified project will not be
returned.project
- the project for which permissions should be consideredfilter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returned@Nonnull Page<PermittedUser> findUsersWithRepositoryPermission(@Nonnull Repository repository, @Nullable String filter, @Nonnull PageRequest pageRequest)
users
and their highest granted permission for the specified
repository. Users which do not have any permissions explicitly assigned to them for the specified
repository will not be returned.repository
- the repository for which permissions should be consideredfilter
- if non-null non-empty then the usernames returned must include this textpageRequest
- bounds the page of users to be returnedvoid setPermission(@Nonnull SetPermissionRequest request)
Note that:
request
- request specifying which permission to grant to which users and/or groupsto grant default project permissions
void revokeAllGlobalPermissions(@Nonnull String group)
group
- name of the groupvoid revokeAllProjectPermissions(@Nonnull Project project, @Nonnull String group)
project
- the project on which permissions are to be revokedgroup
- name of the groupvoid revokeAllRepositoryPermissions(@Nonnull Repository repository, @Nonnull String group)
repository
- the repository on which permissions are to be revokedgroup
- name of the groupvoid revokeAllGlobalPermissions(@Nonnull ApplicationUser user)
user
- user to revoke permissions fromvoid revokeAllProjectPermissions(@Nonnull Project project, @Nonnull ApplicationUser user)
project
- the project on which permissions are to be revokeduser
- user to revoke permissions fromvoid revokeAllRepositoryPermissions(@Nonnull Repository repository, @Nonnull ApplicationUser user)
repository
- the repository on which permissions are to be revokeduser
- user to revoke permissions fromboolean hasAllProjectPermission(@Nonnull Permission permission, @Nonnull Project project)
permission
- the permission to be checked.project
- the project for which the permissions are required.void grantAllProjectPermission(@Nonnull Permission permission, @Nonnull Project project)
permission
- the project permission to be grantedproject
- the project on which permission is to be revokedvoid revokeAllProjectPermission(@Nonnull Permission permission, @Nonnull Project project)
permission
- the project permission to be revokedproject
- the project on which permission is to be revokedvoid revokeAllUserPermissions(@Nonnull String name)
normal
user.
service
users can not be identified by username hence their
permission cannot be revoked by this method.name
- name of the normal uservoid revokeAllUserPermissions(@Nonnull ApplicationUser user)
user
- the userCopyright © 2019 Atlassian. All rights reserved.