@PublicApi public interface PermissionManager extends JiraManager
See JIRA Permissions.
For all global Permissions it is recommended to use GlobalPermissionManager
.
Modifier and Type | Method and Description |
---|---|
void |
addPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue scheme,
String parameter,
String securityType)
Deprecated.
Use
SchemeManager.createSchemeEntity(GenericValue, com.atlassian.jira.scheme.SchemeEntity)
to add project permissions to a permission scheme. Use GlobalPermissionManager.addPermission(com.atlassian.jira.permission.GlobalPermissionType, String)
to add global permissions. Since v6.3. |
Collection<com.atlassian.crowd.embedded.api.Group> |
getAllGroups(int permissionId,
Project project)
Retrieve all groups that are used in the permission globally and in the project.
|
Collection<ProjectPermission> |
getAllProjectPermissions() |
Collection<Project> |
getProjectObjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Since v6.0: Use getProjects(int, ApplicationUser) instead.
Since v6.3: Use getProjects(ProjectPermissionKey, ApplicationUser) instead. |
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)
Deprecated.
Use
getProjects(ProjectPermissionKey, ApplicationUser) instead. Since v6.3. |
Collection<Project> |
getProjects(int permissionId,
ApplicationUser user,
ProjectCategory projectCategory)
Deprecated.
Use
getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory) instead. Since v6.3. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Please use
getProjectObjects(int, com.atlassian.crowd.embedded.api.User) . Since v4.3 |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user,
org.ofbiz.core.entity.GenericValue category)
Deprecated.
Since v5.0: Use getProjects(int, User, ProjectCategory) instead.
Since v6.0: Use getProjects(int, ApplicationUser, ProjectCategory) instead.
Since v6.3: Use getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory) instead. |
Collection<Project> |
getProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user,
ProjectCategory projectCategory)
Deprecated.
Since v6.0: Use getProjects(int, ApplicationUser, ProjectCategory) instead.
Since v6.3: Use getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory) instead. |
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)
Deprecated.
|
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue entity,
com.atlassian.crowd.embedded.api.User u)
Deprecated.
Since v3.11: Use hasPermission(int, Issue, User) for Issues or
hasPermission(int, Project, User) for Projects.
Since v6.0: Use hasPermission(int, Issue, ApplicationUser) for Issues or
hasPermission(int, Project, ApplicationUser) for Projects.
Since v6.3: Use hasPermission(ProjectPermissionKey, Issue, ApplicationUser) for Issues or
hasPermission(ProjectPermissionKey, Project, ApplicationUser) for Projects. |
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue project,
com.atlassian.crowd.embedded.api.User user,
boolean issueCreation)
Deprecated.
Since v3.11: Use hasPermission(int, Issue, User) for Issues or
hasPermission(int, Project, User, boolean) for Projects.
Since v6.0: Use hasPermission(int, Issue, ApplicationUser) for
Issues or hasPermission(int, Project, ApplicationUser, boolean) for
Projects.
Since v6.3: Use hasPermission(ProjectPermissionKey, Issue, ApplicationUser) for
Issues or hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean) for
Projects. |
boolean |
hasPermission(int permissionsId,
Issue issue,
ApplicationUser user)
Deprecated.
Use
hasPermission(ProjectPermissionKey, Issue, ApplicationUser) instead. Since v6.3. |
boolean |
hasPermission(int permissionsId,
Issue issue,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Since v6.0: Use hasPermission(int, Issue, ApplicationUser) instead.
Since v6.3: Use hasPermission(ProjectPermissionKey, Issue, ApplicationUser) instead. |
boolean |
hasPermission(int permissionsId,
Project project,
ApplicationUser user)
Deprecated.
Use
hasPermission(ProjectPermissionKey, Project, ApplicationUser) instead. Since v6.3. |
boolean |
hasPermission(int permissionsId,
Project project,
ApplicationUser user,
boolean issueCreation)
Deprecated.
Use
hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean) instead. Since v6.3. |
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Since v6.0: Use hasPermission(int, Project, ApplicationUser) instead.
Since v6.3: Use hasPermission(ProjectPermissionKey, Project, ApplicationUser) instead. |
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User user,
boolean issueCreation)
Deprecated.
Since v6.0: Use hasPermission(int, Project, ApplicationUser, boolean) instead.
Since v6.3: Use hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean) instead. |
boolean |
hasPermission(int permissionsId,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Use
hasPermission(int, ApplicationUser) instead. Since v6.0. |
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,
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)
Deprecated.
Use
hasProjects(ProjectPermissionKey, ApplicationUser) instead. Since v6.3. |
boolean |
hasProjects(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Deprecated.
Use
hasProjects(ProjectPermissionKey, ApplicationUser) instead. Since v6.3. |
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)
Remove all permissions that have used this group
|
void |
removeUserPermissions(ApplicationUser user)
Remove all permissions that have been assigned to this user
|
void |
removeUserPermissions(String username)
Deprecated.
Use
removeUserPermissions(ApplicationUser) instead. Since v6.0. |
Collection<ProjectPermission> getAllProjectPermissions()
Collection<ProjectPermission> getProjectPermissions(@Nonnull ProjectPermissionCategory category)
category
- project permission category.com.atlassian.fugue.Option<ProjectPermission> getProjectPermission(@Nonnull ProjectPermissionKey permissionKey)
permissionKey
- A project permission key.Option.none()
if there is no permission with this key.@Deprecated void addPermission(int permissionsId, org.ofbiz.core.entity.GenericValue scheme, String parameter, String securityType) throws CreateException
SchemeManager.createSchemeEntity(GenericValue, com.atlassian.jira.scheme.SchemeEntity)
to add project permissions to a permission scheme. Use GlobalPermissionManager.addPermission(com.atlassian.jira.permission.GlobalPermissionType, String)
to add global permissions. Since v6.3.permissionsId
- Permissions value. E.g. See Permissions.ADMINISTER
scheme
- If null permission is global otherwise it is added to the schemeparameter
- Used for e.g. group namesecurityType
- e.g. GroupDropdown.DESCCreateException
- if permission creation fails@Deprecated boolean hasPermission(int permissionsId, com.atlassian.crowd.embedded.api.User user)
hasPermission(int, ApplicationUser)
instead. Since v6.0.permissionsId
- permission iduser
- user, can be null - anonymous userGlobalPermissionManager.hasPermission(int, User)
@Deprecated boolean hasPermission(int permissionsId, ApplicationUser user)
GlobalPermissionManager.hasPermission(com.atlassian.jira.permission.GlobalPermissionType, ApplicationUser)
instead. Since v6.3.permissionsId
- permission iduser
- user, can be null - anonymous userGlobalPermissionManager.hasPermission(int, User)
@Deprecated boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue entity, com.atlassian.crowd.embedded.api.User u)
hasPermission(int, Issue, User)
for Issues or
hasPermission(int, Project, User)
for Projects.
hasPermission(int, Issue, ApplicationUser)
for Issues or
hasPermission(int, Project, ApplicationUser)
for Projects.
hasPermission(ProjectPermissionKey, Issue, ApplicationUser)
for Issues or
hasPermission(ProjectPermissionKey, Project, ApplicationUser)
for Projects.permissionsId
- Not a global permissionentity
- Not null. Must be either an issue or project.u
- User object, possibly null if JIRA is accessed anonymouslyIllegalArgumentException
- If the entity supplied is NOT an issue or project.@Deprecated boolean hasPermission(int permissionsId, Issue issue, com.atlassian.crowd.embedded.api.User user)
hasPermission(int, Issue, ApplicationUser)
instead.
hasPermission(ProjectPermissionKey, Issue, ApplicationUser)
instead.permissionsId
- Not a global permissionissue
- The Issue (cannot be null)user
- User object, possibly null if JIRA is accessed anonymously@Deprecated boolean hasPermission(int permissionsId, Issue issue, ApplicationUser user)
hasPermission(ProjectPermissionKey, Issue, ApplicationUser)
instead. Since v6.3.permissionsId
- Not a global permissionissue
- The Issue (cannot be null)user
- User object, possibly null if JIRA is accessed anonymouslyboolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Issue issue, @Nullable ApplicationUser user)
permissionKey
- Not a global permission keyissue
- The Issue (cannot be null)user
- User object, possibly null if JIRA is accessed anonymously@Deprecated boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User user)
hasPermission(int, Project, ApplicationUser)
instead.
hasPermission(ProjectPermissionKey, Project, ApplicationUser)
instead.permissionsId
- 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 for@Deprecated boolean hasPermission(int permissionsId, Project project, ApplicationUser user)
hasPermission(ProjectPermissionKey, Project, ApplicationUser)
instead. Since v6.3.permissionsId
- 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 forboolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, @Nullable ApplicationUser user)
permissionKey
- 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 forhasProjectWidePermission(ProjectPermissionKey, Project, ApplicationUser)
@ExperimentalApi @Nonnull ProjectWidePermission hasProjectWidePermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, @Nullable ApplicationUser user)
This 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.
permissionKey
- 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_SPECIFIC
hasPermission(ProjectPermissionKey, Project, ApplicationUser)
@Deprecated boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
hasPermission(int, Project, ApplicationUser, boolean)
instead.
hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean)
instead.permissionsId
- 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 creation@Deprecated boolean hasPermission(int permissionsId, Project project, ApplicationUser user, boolean issueCreation)
hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean)
instead. Since v6.3.permissionsId
- 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 creationboolean hasPermission(@Nonnull ProjectPermissionKey permissionKey, @Nonnull Project project, @Nullable ApplicationUser user, boolean issueCreation)
permissionKey
- 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 creation@Deprecated boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
hasPermission(int, Issue, User)
for Issues or
hasPermission(int, Project, User, boolean)
for Projects.
hasPermission(int, Issue, ApplicationUser)
for
Issues or hasPermission(int, Project, ApplicationUser, boolean)
for
Projects.
hasPermission(ProjectPermissionKey, Issue, ApplicationUser)
for
Issues or hasPermission(ProjectPermissionKey, Project, ApplicationUser, boolean)
for
Projects.hasPermission(int,org.ofbiz.core.entity.GenericValue,User)
except
the entity is a project GenericValue
.permissionsId
- Not a global permissionproject
- Not null.user
- User object, possibly null if JIRA is accessed anonymouslyissueCreation
- Whether this permission is being checked during issue creationvoid removeGroupPermissions(String group) throws RemoveException
group
- The name of the group that needs to be removed, must NOT be null and must be a real groupRemoveException
- if permission removal fails@Deprecated void removeUserPermissions(String username) throws RemoveException
removeUserPermissions(ApplicationUser)
instead. Since v6.0.username
- username of the user whose permissions are to be removedRemoveException
- if permission removal failsvoid removeUserPermissions(ApplicationUser user) throws RemoveException
user
- the user whose permissions are to be removedRemoveException
@Deprecated boolean hasProjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
hasProjects(ProjectPermissionKey, ApplicationUser)
instead. Since v6.3.permissionId
- must NOT be a global permissionuser
- user being checked@Deprecated boolean hasProjects(int permissionId, ApplicationUser user)
hasProjects(ProjectPermissionKey, ApplicationUser)
instead. Since v6.3.permissionId
- must NOT be a global permissionuser
- user being checkedboolean hasProjects(@Nonnull ProjectPermissionKey permissionKey, @Nullable ApplicationUser user)
permissionKey
- must NOT be a global permissionuser
- user being checked@Deprecated Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
getProjectObjects(int, com.atlassian.crowd.embedded.api.User)
. Since v4.3permissionId
- must NOT be a global permissionuser
- userGenericValue
objects@Deprecated Collection<Project> getProjectObjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
getProjects(int, ApplicationUser)
instead.
getProjects(ProjectPermissionKey, ApplicationUser)
instead.permissionId
- must NOT be a global permissionuser
- userProject
objects@Deprecated Collection<Project> getProjects(int permissionId, ApplicationUser user)
getProjects(ProjectPermissionKey, ApplicationUser)
instead. Since v6.3.permissionId
- must NOT be a global permissionuser
- userProject
objectsCollection<Project> getProjects(@Nonnull ProjectPermissionKey permissionKey, @Nullable ApplicationUser user)
permissionKey
- must NOT be a global permissionuser
- userProject
objects@Deprecated Collection<org.ofbiz.core.entity.GenericValue> getProjects(int permissionId, com.atlassian.crowd.embedded.api.User user, org.ofbiz.core.entity.GenericValue category)
getProjects(int, User, ProjectCategory)
instead.
getProjects(int, ApplicationUser, ProjectCategory)
instead.
getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory)
instead.permissionId
- permission iduser
- usercategory
- GenericValue representing categoryGenericValue
objects@Deprecated Collection<Project> getProjects(int permissionId, com.atlassian.crowd.embedded.api.User user, ProjectCategory projectCategory)
getProjects(int, ApplicationUser, ProjectCategory)
instead.
getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory)
instead.permissionId
- permission iduser
- userprojectCategory
- the ProjectCategory@Deprecated Collection<Project> getProjects(int permissionId, ApplicationUser user, ProjectCategory projectCategory)
getProjects(ProjectPermissionKey, ApplicationUser, ProjectCategory)
instead. Since v6.3.permissionId
- permission iduser
- userprojectCategory
- the ProjectCategoryCollection<Project> getProjects(@Nonnull ProjectPermissionKey permissionKey, @Nullable ApplicationUser user, @Nullable ProjectCategory projectCategory)
permissionKey
- permission keyuser
- userprojectCategory
- the ProjectCategory - null means find projects with no category.Collection<com.atlassian.crowd.embedded.api.Group> getAllGroups(int permissionId, Project project)
permissionId
- permission idproject
- project from which to retrieve groupsCopyright © 2002-2015 Atlassian. All Rights Reserved.