public class SubvertedPermissionManager extends Object implements PermissionManager
| Constructor and Description |
|---|
SubvertedPermissionManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
flushCache()
Flushes any cached project permissions for all users.
|
Collection<com.atlassian.crowd.embedded.api.Group> |
getAllGroups(int permType,
Project project)
Not implemented.
|
Collection<ProjectPermission> |
getAllProjectPermissions() |
Collection<Project> |
getArchivedProjects(ProjectPermissionKey permissionKey,
ApplicationUser user)
Retrieve a list of archived project objects this user has the permission for
|
com.atlassian.fugue.Option<ProjectPermission> |
getProjectPermission(ProjectPermissionKey permissionKey)
Returns a project permission matching the specified key.
|
Collection<ProjectPermission> |
getProjectPermissions(ProjectPermissionCategory category) |
Collection<Project> |
getProjects(int permissionId,
ApplicationUser user)
Retrieve a list of project objects this user has the permission for
|
Collection<Project> |
getProjects(int permissionId,
ApplicationUser user,
ProjectCategory projectCategory)
Returns the list of projects associated with the specified category, that this user has the permissions for.
|
Collection<Project> |
getProjects(ProjectPermissionKey permissionKey,
ApplicationUser user)
Retrieve a list of project objects this user has the permission for
|
Collection<Project> |
getProjects(ProjectPermissionKey permissionKey,
ApplicationUser user,
ProjectCategory projectCategory)
Returns the list of projects associated with the specified category, that this user has the permissions for.
|
boolean |
hasPermission(int permissionsId,
ApplicationUser user)
Checks to see if this user has the specified permission.
|
boolean |
hasPermission(int permissionsId,
Issue issue,
ApplicationUser user)
Checks to see if this user has permission to see the specified issue.
|
boolean |
hasPermission(int permissionsId,
Project project,
ApplicationUser user)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(int permissionsId,
Project project,
ApplicationUser user,
boolean issueCreation)
Always return true.
|
boolean |
hasPermission(ProjectPermissionKey permissionKey,
Issue issue,
ApplicationUser user)
Checks to see if this user has permission to see the specified issue.
|
boolean |
hasPermission(ProjectPermissionKey permissionKey,
Issue issue,
ApplicationUser user,
com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Checks to see if this user has the given permission to the specified issue after the given workflow transition takes effect.
|
boolean |
hasPermission(ProjectPermissionKey permissionKey,
Issue issue,
ApplicationUser user,
Status status)
Checks to see if this user has the given permission to the specified issue if the issue was in the given status.
|
boolean |
hasPermission(ProjectPermissionKey permissionKey,
Project project,
ApplicationUser user)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(ProjectPermissionKey permissionKey,
Project project,
ApplicationUser user,
boolean issueCreation)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasProjects(int permissionId,
ApplicationUser user)
Can this user see at least one project with this permission
|
boolean |
hasProjects(ProjectPermissionKey permissionKey,
ApplicationUser user)
Can this user see at least one project with this permission
|
ProjectWidePermission |
hasProjectWidePermission(ProjectPermissionKey permissionKey,
Project project,
ApplicationUser user)
Checks whether a user has a particular permission in the given project.
|
void |
removeGroupPermissions(String group)
Not implemented.
|
void |
removeUserPermissions(ApplicationUser user)
Not implemented.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasPublicAccesspublic Collection<ProjectPermission> getAllProjectPermissions()
getAllProjectPermissions in interface PermissionManagerpublic Collection<ProjectPermission> getProjectPermissions(@Nonnull ProjectPermissionCategory category)
getProjectPermissions in interface PermissionManagercategory - project permission category.public com.atlassian.fugue.Option<ProjectPermission> getProjectPermission(@Nonnull ProjectPermissionKey permissionKey)
PermissionManagergetProjectPermission in interface PermissionManagerpermissionKey - A project permission key.Option.none() if there is no permission with this key.public Collection<Project> getProjects(int permissionId, ApplicationUser user)
PermissionManagergetProjects in interface PermissionManagerpermissionId - must NOT be a global permissionuser - userProject objectspublic Collection<Project> getProjects(@Nonnull ProjectPermissionKey permissionKey, ApplicationUser user)
PermissionManagergetProjects in interface PermissionManagerpermissionKey - must NOT be a global permissionuser - userProject objectspublic Collection<Project> getProjects(int permissionId, ApplicationUser user, ProjectCategory projectCategory)
PermissionManagergetProjects in interface PermissionManagerpermissionId - permission iduser - userprojectCategory - the ProjectCategorypublic Collection<Project> getProjects(@Nonnull ProjectPermissionKey permissionKey, @Nullable ApplicationUser user, @Nullable ProjectCategory projectCategory)
PermissionManagergetProjects in interface PermissionManagerpermissionKey - permission keyuser - userprojectCategory - the ProjectCategory - null means find projects with no category.public Collection<Project> getArchivedProjects(@Nonnull ProjectPermissionKey permissionKey, ApplicationUser user)
PermissionManagergetArchivedProjects in interface PermissionManagerpermissionKey - must NOT be a global permissionuser - userProject objectspublic void flushCache()
PermissionManagerflushCache in interface PermissionManagerpublic boolean hasProjects(int permissionId,
ApplicationUser user)
PermissionManagerhasProjects in interface PermissionManagerpermissionId - must NOT be a global permissionuser - user being checkedpublic boolean hasProjects(@Nonnull ProjectPermissionKey permissionKey, ApplicationUser user)
PermissionManagerhasProjects in interface PermissionManagerpermissionKey - must NOT be a global permissionuser - user being checkedpublic void removeGroupPermissions(String group)
removeGroupPermissions in interface PermissionManagergroup - The name of the group that needs to be removed, must NOT be null and must be a real grouppublic void removeUserPermissions(ApplicationUser user) throws RemoveException
removeUserPermissions in interface PermissionManageruser - the user whose permissions are to be removedRemoveExceptionpublic Collection<com.atlassian.crowd.embedded.api.Group> getAllGroups(int permType, Project project)
getAllGroups in interface PermissionManagerpermType - permission idproject - project from which to retrieve groupspublic boolean hasPermission(int permissionsId,
ApplicationUser user)
PermissionManagerhasPermission in interface PermissionManagerpermissionsId - permission iduser - user, can be null - anonymous userGlobalPermissionManager.hasPermission(int, ApplicationUser)public boolean hasPermission(int permissionsId,
Issue issue,
ApplicationUser user)
PermissionManagerNote that if the issue's generic value is null, it is assumed that the issue is currently being created, and so the permission check call is deferred to the issue's project object, with the issueCreation flag set to true. See JRA-14788 for more info.
hasPermission in interface PermissionManagerpermissionsId - Not a global permissionissue - The Issue (cannot be null)user - User object, possibly null if JIRA is accessed anonymouslypublic boolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Issue issue, ApplicationUser user)
PermissionManagerNote that if the issue's generic value is null, it is assumed that the issue is currently being created, and so the permission check call is deferred to the issue's project object, with the issueCreation flag set to true. See JRA-14788 for more info.
hasPermission in interface PermissionManagerpermissionKey - Not a global permission keyissue - The Issue (cannot be null)user - User object, possibly null if JIRA is accessed anonymouslypublic boolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Issue issue, @Nullable ApplicationUser user, @Nullable com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
PermissionManagerhasPermission in interface PermissionManagerpermissionKey - The project permission key.issue - The Issue (cannot be null)user - User object, possibly null if JIRA is accessed anonymouslyactionDescriptor - Represents the current workflow transitionpublic boolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Issue issue, @Nullable ApplicationUser user, @Nonnull Status status)
PermissionManagerThis method is useful during a workflow transition to check what the permissions will be in the new status, or (after the status is updated in the Issue object) to check what the permission would have been in the old status.
hasPermission in interface PermissionManagerpermissionKey - The project permission key.issue - The Issue (cannot be null)user - User object, possibly null if JIRA is accessed anonymouslystatus - Represents the state we are checking permissions againstpublic boolean hasPermission(int permissionsId,
Project project,
ApplicationUser user)
PermissionManagerhasPermission in interface PermissionManagerpermissionsId - A non-global permission, i.e. a permission that is granted via a project contextproject - The project that is the context of the permission check.user - The person to perform the permission check forpublic boolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, @Nullable ApplicationUser user)
PermissionManagerhasPermission in interface PermissionManagerpermissionKey - A non-global permission, i.e. a permission that is granted via a project contextproject - The project that is the context of the permission check.user - The person to perform the permission check forPermissionManager.hasProjectWidePermission(ProjectPermissionKey, Project, ApplicationUser)@Nonnull public ProjectWidePermission hasProjectWidePermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, @Nullable ApplicationUser user)
PermissionManagerThis method returns a tri-state enum in order to convey information about permissions that are granted on a per-issue basis.
ISSUE_SPECIFIC, it may be that there are no issues for which the
user has the permission granted.
hasProjectWidePermission in interface PermissionManagerpermissionKey - A project permissionproject - The project that is the context of the permission check.user - The person to perform the permission check for (null means anonymous)ALL_ISSUES, NO_ISSUES, or ISSUE_SPECIFICPermissionManager.hasPermission(ProjectPermissionKey, Project, ApplicationUser)public boolean hasPermission(int permissionsId,
Project project,
ApplicationUser user,
boolean issueCreation)
hasPermission in interface PermissionManagerpermissionsId - ignoredproject - ignoreduser - ignoredissueCreation - ignoredpublic boolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, ApplicationUser user, boolean issueCreation)
PermissionManagerhasPermission in interface PermissionManagerpermissionKey - A non-global permission, i.e. a permission that is granted via a project contextproject - The project that is the context of the permission check.user - The person to perform the permission check forissueCreation - Whether this permission is being checked during issue creationCopyright © 2002-2019 Atlassian. All Rights Reserved.