|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.security.DefaultPermissionManager com.atlassian.jira.mock.MockPermissionManager
public class MockPermissionManager
Field Summary | |
---|---|
protected Collection<JiraPermission> |
permissions
|
Constructor Summary | |
---|---|
MockPermissionManager()
|
|
MockPermissionManager(boolean defaultPermission)
Creates a PermissionManager implementation where, by default, all permissions are given or denied based on the given value. |
Method Summary | |
---|---|
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 |
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)
|
Methods inherited from class com.atlassian.jira.security.DefaultPermissionManager |
---|
addPermission, getAllGroups, getAllProjectPermissions, getProjectObjects, getProjectObjects, getProjectPermission, getProjectPermissions, getProjects, getProjects, getProjects, getProjects, getProjects, getProjects, getProjects, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasPermission, hasProjects, isGlobalPermission, removeUserPermissions, removeUserPermissions, setProjectPermissionTypesManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Collection<JiraPermission> permissions
Constructor Detail |
---|
public MockPermissionManager()
public MockPermissionManager(boolean defaultPermission)
defaultPermission
- if true, everything is permitted, if false, everything is denied.Method Detail |
---|
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 group
RemoveException
- 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 creation
public 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 creation
public boolean hasPermission(int permissionsId, com.atlassian.crowd.embedded.api.User u)
DefaultPermissionManager
hasPermission
in interface PermissionManager
hasPermission
in class DefaultPermissionManager
permissionsId
- permission idu
- user
GlobalPermissionManager.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 user
GlobalPermissionManager.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 anonymously
public 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 anonymously
public 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 anonymously
public 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 for
public 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 for
public 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 creation
public 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
- user
public boolean hasProjects(int permissionId, ApplicationUser user)
PermissionManager
hasProjects
in interface PermissionManager
hasProjects
in class DefaultPermissionManager
permissionId
- must NOT be a global permissionuser
- user being checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |