public abstract class AbstractIssueFieldSecurityType extends AbstractSecurityType
Constructor and Description |
---|
AbstractIssueFieldSecurityType() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
getFieldName(String parameter)
Get the field name for this Issue Field-based Security Type given the parameter in the saved configuration.
|
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). |
Set<org.apache.lucene.util.BytesRef> |
getPermissionFieldContents(ApplicationUser searcher,
Project project,
String parameter)
Returns a set of (
project permission field )
contents based on the project and optionally the parameter (for role-based queries). |
protected Set<org.apache.lucene.util.BytesRef> |
getPermissionFieldContentsForProject(Project project,
ApplicationUser searcher,
String fieldName)
Gets called to produce the Lucene query for a project
|
protected Set<org.apache.lucene.util.BytesRef> |
getPermissionFieldContentsForSecurityLevel(IssueSecurityLevel issueSecurity,
ApplicationUser searcher,
String fieldName)
Produces a Lucene query for a given issue security type such that documents
match the query only when the given user is defined for the issue by this
custom field in the given security.
|
protected abstract boolean |
hasIssuePermission(ApplicationUser user,
boolean issueCreation,
Issue issue,
String parameter) |
boolean |
hasPermission(Issue issue,
String argument)
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 parameter,
ApplicationUser user,
boolean issueCreation)
Determines if this permission type is satisfied.
|
protected abstract boolean |
hasProjectPermission(ApplicationUser user,
boolean issueCreation,
Project project) |
boolean |
isTopLevelIssueSecurityPermission()
Returns true if this permission depends only on a issue security level value and not on project or any field value.
|
boolean |
isTopLevelProjectPermission()
Returns true if this permission depends only on a project value and not on issue security level or any field value.
|
getArgumentDisplay, isValidForPermission
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUsers
doValidation, getDisplayName, getType
public boolean isTopLevelProjectPermission()
SecurityType
protected abstract String getFieldName(String parameter)
Some Field based permissions are based on hard-coded fields like assignee and reporter in which case the parameter is not used. Other types use the parameter to name the particular User or Group custom field that is used for the permission.
parameter
- the parameter as saved in the configpublic Set<org.apache.lucene.util.BytesRef> getPermissionFieldContents(ApplicationUser searcher, @Nonnull Project project, String parameter)
SecurityType
project permission field
)
contents based on the project and optionally the parameter (for role-based queries).
This is needed to build project security scheme query.searcher
- The searcher conducting the searchproject
- The project for which we're constructing the permissions field contentsparameter
- Parameter identifying user related field (reporter, assignee, etc)SecurityIndexingUtils
public boolean isTopLevelIssueSecurityPermission()
SecurityType
public Set<org.apache.lucene.util.BytesRef> getPermissionFieldContents(ApplicationUser searcher, Project project, IssueSecurityLevel securityLevel, String parameter)
SecurityType
issue 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.searcher
- 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)SecurityIndexingUtils
@Nullable protected Set<org.apache.lucene.util.BytesRef> getPermissionFieldContentsForProject(@Nonnull Project project, @Nullable ApplicationUser searcher, @Nonnull String fieldName)
project
- The project for which to construct a querysearcher
- The user who is searching to add to the querynull
if the searcher is either
null
or not a known user@Nullable protected Set<org.apache.lucene.util.BytesRef> getPermissionFieldContentsForSecurityLevel(@Nonnull IssueSecurityLevel issueSecurity, @Nullable ApplicationUser searcher, @Nonnull String fieldName)
issueSecurity
- the security defined by this IssueFieldSecurityType instance.searcher
- the user.null
if user is either
null
or not a known userpublic boolean hasPermission(Issue issue, String argument)
SchemeType
issue
- This is the issue 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(Project project, String argument)
SchemeType
project
- 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, ApplicationUser user, boolean issueCreation)
SchemeType
issue
- 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 boolean hasPermission(Project project, String parameter, ApplicationUser user, boolean issueCreation)
SchemeType
project
- This is the project 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 creationprotected abstract boolean hasIssuePermission(ApplicationUser user, boolean issueCreation, Issue issue, String parameter)
protected abstract boolean hasProjectPermission(ApplicationUser user, boolean issueCreation, Project project)
Copyright © 2002-2023 Atlassian. All Rights Reserved.