Package com.atlassian.bamboo.project
Class DefaultProjectPermissionsService
java.lang.Object
com.atlassian.bamboo.project.DefaultProjectPermissionsService
- All Implemented Interfaces:
ProjectPermissionsService
-
Constructor Summary
ConstructorDescriptionDefaultProjectPermissionsService
(HibernateMutableAclService aclService, TransactionAndHibernateTemplate hibernateTemplate, BambooAclHelper aclHelper, ProjectManager projectManager, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAnonymousPermission
(@NotNull String projectKey) Grants READ permission for anonymous user to project.boolean
addGroupPermissionsToProject
(@NotNull String projectKey, @NotNull String group, @NotNull List<BambooPermission> permissionsToAdd) boolean
addLoggedInPermissionsToProject
(@NotNull String projectKey, @NotNull List<BambooPermission> permissionsToAdd) boolean
addUserPermissionsToProject
(@NotNull String projectKey, @NotNull String username, @NotNull List<BambooPermission> permissionsToAdd) getAnonymousPermissions
(@NotNull String projectKey) @NotNull List<BambooPermission>
getGroupPermissionsForProject
(@NotNull String projectKey, @NotNull String group) @NotNull List<BambooPermission>
getLoggedInPermissionsForProject
(@NotNull String projectKey) @NotNull List<BambooPermission>
getUserPermissionsForProject
(@NotNull String projectKey, @NotNull String username) listGroupsWithPermissionsForProject
(@NotNull String projectKey) listUsersWithPermissionsForProject
(@NotNull String projectKey) @NotNull Collection<BambooPermission>
permissionDependencies
(@NotNull BambooPermission permission) Obtain a collection of Bamboo permissions dependent on the passedpermission
.boolean
removeAnonymousPermission
(@NotNull String projectKey) Revoke READ permission from project for anonymous user.boolean
removeGroupPermissionsFromProject
(@NotNull String projectKey, @NotNull String group, @NotNull List<BambooPermission> permissionsToRemove) boolean
removeLoggedInPermissionsFromProject
(@NotNull String projectKey, @NotNull List<BambooPermission> permissionsToRemove) boolean
removeUserPermissionsFromProject
(@NotNull String projectKey, @NotNull String username, @NotNull List<BambooPermission> permissionsToRemove) @NotNull Collection<BambooPermission>
Collection of permissions configurable for projects.
-
Constructor Details
-
DefaultProjectPermissionsService
@Autowired public DefaultProjectPermissionsService(HibernateMutableAclService aclService, TransactionAndHibernateTemplate hibernateTemplate, BambooAclHelper aclHelper, ProjectManager projectManager, BambooPermissionManager bambooPermissionManager, BambooUserManager bambooUserManager, FeatureManager featureManager)
-
-
Method Details
-
listUsersWithPermissionsForProject
@NotNull public @NotNull Iterable<String> listUsersWithPermissionsForProject(@NotNull @NotNull String projectKey) - Specified by:
listUsersWithPermissionsForProject
in interfaceProjectPermissionsService
-
getUserPermissionsForProject
@NotNull public @NotNull List<BambooPermission> getUserPermissionsForProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String username) - Specified by:
getUserPermissionsForProject
in interfaceProjectPermissionsService
-
addUserPermissionsToProject
public boolean addUserPermissionsToProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String username, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addUserPermissionsToProject
in interfaceProjectPermissionsService
-
removeUserPermissionsFromProject
public boolean removeUserPermissionsFromProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String username, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeUserPermissionsFromProject
in interfaceProjectPermissionsService
-
listGroupsWithPermissionsForProject
@NotNull public @NotNull Iterable<String> listGroupsWithPermissionsForProject(@NotNull @NotNull String projectKey) - Specified by:
listGroupsWithPermissionsForProject
in interfaceProjectPermissionsService
-
getGroupPermissionsForProject
@NotNull public @NotNull List<BambooPermission> getGroupPermissionsForProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String group) - Specified by:
getGroupPermissionsForProject
in interfaceProjectPermissionsService
-
addGroupPermissionsToProject
public boolean addGroupPermissionsToProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String group, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addGroupPermissionsToProject
in interfaceProjectPermissionsService
-
removeGroupPermissionsFromProject
public boolean removeGroupPermissionsFromProject(@NotNull @NotNull String projectKey, @NotNull @NotNull String group, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeGroupPermissionsFromProject
in interfaceProjectPermissionsService
-
getLoggedInPermissionsForProject
@NotNull public @NotNull List<BambooPermission> getLoggedInPermissionsForProject(@NotNull @NotNull String projectKey) - Specified by:
getLoggedInPermissionsForProject
in interfaceProjectPermissionsService
-
addLoggedInPermissionsToProject
public boolean addLoggedInPermissionsToProject(@NotNull @NotNull String projectKey, @NotNull @NotNull List<BambooPermission> permissionsToAdd) - Specified by:
addLoggedInPermissionsToProject
in interfaceProjectPermissionsService
-
removeLoggedInPermissionsFromProject
public boolean removeLoggedInPermissionsFromProject(@NotNull @NotNull String projectKey, @NotNull @NotNull List<BambooPermission> permissionsToRemove) - Specified by:
removeLoggedInPermissionsFromProject
in interfaceProjectPermissionsService
-
supportedPermissions
Description copied from interface:ProjectPermissionsService
Collection of permissions configurable for projects.Ordered by permission importance. Least granting permissions come first.
- Specified by:
supportedPermissions
in interfaceProjectPermissionsService
-
permissionDependencies
@NotNull public @NotNull Collection<BambooPermission> permissionDependencies(@NotNull @NotNull BambooPermission permission) Description copied from interface:ProjectPermissionsService
Obtain a collection of Bamboo permissions dependent on the passedpermission
. A dependent permission is expected to always be granted whenever the parent permission is granted too.The result is an effective collection of dependencies, meaning there's no need to recursively traverse the dependency graph.
- Specified by:
permissionDependencies
in interfaceProjectPermissionsService
-
getAnonymousPermissions
- Specified by:
getAnonymousPermissions
in interfaceProjectPermissionsService
- Returns:
- permissions of anonymous user for project
-
addAnonymousPermission
Description copied from interface:ProjectPermissionsService
Grants READ permission for anonymous user to project.- Specified by:
addAnonymousPermission
in interfaceProjectPermissionsService
- Returns:
- true if permission was granted
-
removeAnonymousPermission
Description copied from interface:ProjectPermissionsService
Revoke READ permission from project for anonymous user.- Specified by:
removeAnonymousPermission
in interfaceProjectPermissionsService
- Returns:
- true if permission was revoked.
-