public class ProjectRoleSecurityAndNotificationType extends AbstractProjectsSecurityType implements NotificationType, SecurityType
| Modifier and Type | Field and Description |
|---|---|
static String |
PROJECT_ROLE |
| Constructor and Description |
|---|
ProjectRoleSecurityAndNotificationType(JiraAuthenticationContext jiraAuthenticationContext,
ProjectRoleManager projectRoleManager,
ProjectFactory projectFactory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doValidation(String key,
Map parameters)
Validate the configuration (the argument in
NotificationType.getRecipients(com.atlassian.jira.event.issue.IssueEvent, String))
when it is entered in the "Add Notification" page. |
void |
doValidation(String key,
Map parameters,
JiraServiceContext jiraServiceContext) |
String |
getArgumentDisplay(String roleTypeId)
Obtains the user-friendly display for the argument.
|
String |
getArgumentValue(String roleTypeId)
Obtains the raw parameter value to save for the given user entry user-friendly display value.
|
String |
getDisplayName()
Text to display for this type, on the "Add Notification" page.
|
Set<org.apache.lucene.util.BytesRef> |
getPermissionFieldContents(ApplicationUser searcher,
Project project,
IssueSecurityLevel securityLevel,
String parameter)
Returns a set of (
issue level permission field)
contents based on the security level, the project and optionally the parameter (for role-based queries). |
Collection<ProjectRole> |
getProjectRoles() |
List<NotificationRecipient> |
getRecipients(IssueEvent event,
String roleId)
Who is to be notified of an event.
|
String |
getType()
Type identifier (currently unused).
|
Set<ApplicationUser> |
getUsers(PermissionContext permissionContext,
String roleId)
Returns a list of
ApplicationUsers represented by a security type instance. |
protected Set<ApplicationUser> |
getUsersFromRole(Project project,
String roleId)
Get all the users that satisfy this particular role.
|
boolean |
hasPermission(Issue issue,
String parameter)
Determines if this permission type is satisfied for anonymous access.
|
boolean |
hasPermission(Issue issue,
String parameter,
ApplicationUser user,
boolean issueCreation)
Determines if this permission type is satisfied.
|
boolean |
hasPermission(Project project,
String argument)
Determines if this permission type is satisfied for anonymous access.
|
boolean |
hasPermission(Project project,
String argument,
ApplicationUser user,
boolean issueCreation)
Determines if this permission type is satisfied.
|
boolean |
isTopLevelIssueSecurityPermission()
Returns true if this permission depends only on a issue security level value and not on project or any field value.
|
getPermissionFieldContents, getPermissionFieldContents, isTopLevelProjectPermissionisValidForPermissionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPermissionFieldContents, isTopLevelProjectPermissionisValidForPermissionpublic static final String PROJECT_ROLE
public ProjectRoleSecurityAndNotificationType(JiraAuthenticationContext jiraAuthenticationContext, ProjectRoleManager projectRoleManager, ProjectFactory projectFactory)
public boolean isTopLevelIssueSecurityPermission()
SecurityTypeisTopLevelIssueSecurityPermission in interface SecurityTypeisTopLevelIssueSecurityPermission in class AbstractProjectsSecurityTypepublic Set<org.apache.lucene.util.BytesRef> getPermissionFieldContents(ApplicationUser searcher, Project project, IssueSecurityLevel securityLevel, String parameter)
SecurityTypeissue level permission field)
contents based on the security level, the project and optionally the parameter (for role-based queries).
This is needed to build issue security level query.getPermissionFieldContents in interface SecurityTypegetPermissionFieldContents in class AbstractProjectsSecurityTypesearcher - The searcher conducting the searchproject - The project for which we're constructing a querysecurityLevel - The security level for which we are constructing the permissions field contentsparameter - Parameter identifying user related field (reporter, assignee, etc)SecurityIndexingUtilspublic Collection<ProjectRole> getProjectRoles()
public String getDisplayName()
NotificationTypegetDisplayName in interface NotificationTypegetDisplayName in interface SchemeTypepublic String getType()
NotificationTypegetType in interface NotificationTypegetType in interface SchemeTypepublic void doValidation(String key, Map parameters, JiraServiceContext jiraServiceContext)
doValidation in interface SchemeTypepublic boolean doValidation(String key, Map parameters)
NotificationTypeNotificationType.getRecipients(com.atlassian.jira.event.issue.IssueEvent, String))
when it is entered in the "Add Notification" page.
For instance, a group notification type might check if the entered group exists.doValidation in interface NotificationTypekey - Key of relevant value in parametersparameters - HTML form parameters (only the keyed entry is relevant).public String getArgumentDisplay(String roleTypeId)
NotificationTypegetArgumentDisplay in interface NotificationTypegetArgumentDisplay in interface SecurityTypegetArgumentDisplay in class AbstractSecurityTyperoleTypeId - Raw configuration valuepublic String getArgumentValue(String roleTypeId)
NotificationTypegetArgumentValue in interface NotificationTyperoleTypeId - Value entered into the form (username, for example)public Set<ApplicationUser> getUsers(PermissionContext permissionContext, String roleId)
SecurityTypeApplicationUsers represented by a security type instance. The collection must
not contain any nulls.getUsers in interface SecurityTypepermissionContext - The current issue and projectroleId - Instance value, eg. a group name, user name, custom field idApplicationUsers.public boolean hasPermission(Project project, String argument)
SchemeTypehasPermission in interface SchemeTypeproject - This is the project that the security is being checked forargument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)public boolean hasPermission(Issue issue, String parameter)
SchemeTypehasPermission in interface SchemeTypeissue - This is the issue that the security is being checked forparameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)public boolean hasPermission(Project project, String argument, ApplicationUser user, boolean issueCreation)
SchemeTypehasPermission in interface SchemeTypeproject - This is the project that the security is being checked forargument - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)user - The user for whom the permission is being checkedissueCreation - Whether this permission is being checked during issue creationpublic boolean hasPermission(Issue issue, String parameter, ApplicationUser user, boolean issueCreation)
SchemeTypehasPermission in interface SchemeTypeissue - This is the issue that the security is being checked forparameter - If this particular SchemeType has been configured with a parameter, then this parameter is passed (eg. Group Name for GroupDropdown)user - The user for whom the permission is being checkedissueCreation - Whether this permission is being checked during issue creationpublic List<NotificationRecipient> getRecipients(IssueEvent event, String roleId)
NotificationTypegetRecipients in interface NotificationTypeevent - The event, eg. issue createdroleId - Configuration from notification scheme, eg. group name, custom field id.NotificationRecipients.protected Set<ApplicationUser> getUsersFromRole(Project project, String roleId)
Protected access so it can be directly called from unittests
project - the project you to find want users forroleId - the specific role you want to find users forUser objectsCopyright © 2002-2022 Atlassian. All Rights Reserved.