public class MockPermissionManager extends DefaultPermissionManager
Modifier and Type | Field and Description |
---|---|
protected Collection<JiraPermission> |
permissions |
Constructor and Description |
---|
MockPermissionManager() |
MockPermissionManager(boolean defaultPermission)
Creates a PermissionManager implementation where, by default, all permissions are given or denied based on the
given value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasPermission(int permissionsId,
ApplicationUser user)
Checks to see if this user has the specified permission.
|
boolean |
hasPermission(int permissionId,
org.ofbiz.core.entity.GenericValue projectOrIssue,
com.atlassian.crowd.embedded.api.User user)
Checks to see if this has permission to see the specified entity
Check Permissions scheme(s) if the entity is project Check Permissions scheme(s) and issue level security scheme(s) if the entity is an issue |
boolean |
hasPermission(int permissionsId,
org.ofbiz.core.entity.GenericValue project,
com.atlassian.crowd.embedded.api.User user,
boolean issueCreation)
Does the same as
PermissionManager.hasPermission(int,org.ofbiz.core.entity.GenericValue,User) except
the entity is a project GenericValue . |
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,
Issue issue,
com.atlassian.crowd.embedded.api.User 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)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User user)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(int permissionsId,
Project project,
com.atlassian.crowd.embedded.api.User u,
boolean issueCreation)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(int permissionsId,
com.atlassian.crowd.embedded.api.User u)
Checks to see if this user has the specified permission
It will check only global permissions as there are no other permissions to check |
boolean |
hasPermission(ProjectPermissionKey projectPermissionKey,
Project project,
ApplicationUser user)
Checks whether the specified user has a specified permission within the context of a specified project.
|
boolean |
hasPermission(ProjectPermissionKey projectPermissionKey,
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(int permissionId,
com.atlassian.crowd.embedded.api.User user)
Can this user see at least one project with this permission
|
boolean |
isDefaultPermission() |
void |
removeGroupPermissions(String group)
Remove all permissions that have used this group
|
void |
setDefaultPermission(boolean defaultPermission) |
addPermission, getAllGroups, getAllProjectPermissions, getProjectObjects, getProjectObjects, getProjectPermission, getProjectPermissions, getProjects, getProjects, getProjects, getProjects, getProjects, getProjects, getProjects, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasProjects, isGlobalPermission, removeUserPermissions, removeUserPermissions, setProjectPermissionTypesManager
protected Collection<JiraPermission> permissions
public MockPermissionManager()
public MockPermissionManager(boolean defaultPermission)
defaultPermission
- if true, everything is permitted, if false, everything is denied.public boolean isDefaultPermission()
public void setDefaultPermission(boolean defaultPermission)
public void removeGroupPermissions(String group) throws RemoveException
DefaultPermissionManager
removeGroupPermissions
in interface PermissionManager
removeGroupPermissions
in class DefaultPermissionManager
group
- The name of the group that needs to be removed, must NOT be null and must be a real groupRemoveException
- if permission removal failspublic boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User u, boolean issueCreation)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
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.u
- The person to perform the permission check forissueCreation
- Whether this permission is being checked during issue creationpublic boolean hasPermission(int permissionsId, org.ofbiz.core.entity.GenericValue project, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
PermissionManager
PermissionManager.hasPermission(int,org.ofbiz.core.entity.GenericValue,User)
except
the entity is a project GenericValue
.hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
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 creationpublic boolean hasPermission(int permissionsId, com.atlassian.crowd.embedded.api.User u)
DefaultPermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionsId
- permission idu
- userGlobalPermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionsId, ApplicationUser user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionsId
- permission iduser
- user, can be null - anonymous userGlobalPermissionManager.hasPermission(int, User)
public boolean hasPermission(int permissionId, org.ofbiz.core.entity.GenericValue projectOrIssue, com.atlassian.crowd.embedded.api.User user)
DefaultPermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionId
- Not a global permissionprojectOrIssue
- not null must be Project or Issueuser
- User object, possibly null if JIRA is accessed anonymouslypublic boolean hasPermission(int permissionsId, Issue issue, com.atlassian.crowd.embedded.api.User user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionsId
- Not a global permissionissue
- The Issue (cannot be null)user
- User object, possibly null if JIRA is accessed anonymouslypublic boolean hasPermission(int permissionsId, Issue issue, ApplicationUser user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionsId
- Not a global permissionissue
- The Issue (cannot be null)user
- User object, possibly null if JIRA is accessed anonymouslypublic boolean hasPermission(int permissionsId, Project project, com.atlassian.crowd.embedded.api.User user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
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 forpublic boolean hasPermission(int permissionsId, Project project, ApplicationUser user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
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 forpublic boolean hasPermission(int permissionsId, Project project, ApplicationUser user, boolean issueCreation)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
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 creationpublic boolean hasPermission(ProjectPermissionKey projectPermissionKey, Project project, ApplicationUser user, boolean issueCreation)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
projectPermissionKey
- 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 creationpublic boolean hasProjects(int permissionId, com.atlassian.crowd.embedded.api.User user)
DefaultPermissionManager
hasProjects
in interface PermissionManager
hasProjects
in class DefaultPermissionManager
permissionId
- must NOT be a global permissionuser
- userpublic boolean hasProjects(int permissionId, ApplicationUser user)
PermissionManager
hasProjects
in interface PermissionManager
hasProjects
in class DefaultPermissionManager
permissionId
- must NOT be a global permissionuser
- user being checkedpublic boolean hasPermission(ProjectPermissionKey projectPermissionKey, Project project, ApplicationUser user)
PermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
projectPermissionKey
- 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 forCopyright © 2002-2015 Atlassian. All Rights Reserved.