Interface SecurityType

All Superinterfaces:
SchemeType
All Known Implementing Classes:
AbstractIssueFieldSecurityType, AbstractProjectsSecurityType, AbstractSecurityType, ApplicationRoleSecurityType, CurrentAssignee, CurrentAssigneeHasAssignablePermission, CurrentReporter, CurrentReporterHasCreatePermission, GroupCF, GroupDropdown, ProjectLead, ProjectRoleSecurityAndNotificationType, SimpleIssueFieldSecurityType, SingleUser, UserCF

public interface SecurityType extends SchemeType
  • Method Details

    • isTopLevelProjectPermission

      boolean isTopLevelProjectPermission()
      Returns true if this permission depends only on a project value and not on issue security level or any field value. Used for optimisation.
    • isTopLevelIssueSecurityPermission

      boolean isTopLevelIssueSecurityPermission()
      Returns true if this permission depends only on a issue security level value and not on project or any field value. Used for optimisation.
    • getPermissionFieldContents

      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). This is needed to build project security scheme query.
      Parameters:
      searcher - The searcher conducting the search
      project - The project for which we're constructing the permissions field contents
      parameter - Parameter identifying user related field (reporter, assignee, etc)
      Returns:
      A set of Lucene permissions field tuples
      See Also:
    • getPermissionFieldContents

      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). This is needed to build issue security level query.
      Parameters:
      searcher - The searcher conducting the search
      project - The project for which we're constructing a query
      securityLevel - The security level for which we are constructing the permissions field contents
      parameter - Parameter identifying user related field (reporter, assignee, etc)
      Returns:
      A set of Lucene permissions field tuples
      See Also:
    • getArgumentDisplay

      String getArgumentDisplay(String argument)
    • getUsers

      @Deprecated Set<ApplicationUser> getUsers(@Nonnull PermissionContext permissionContext, @Nullable String argument)
      Deprecated.
      Returns a set of ApplicationUsers represented by a security type instance. The collection must not contain any nulls.
      Parameters:
      permissionContext - The current issue and project
      argument - Instance value, eg. a group name, user name, custom field id
      Returns:
      A set of ApplicationUsers.
      Throws:
      IllegalArgumentException - if argument is invalid for this type.
    • getUsers

      @Nonnull default Set<ApplicationUser> getUsers(@Nonnull PermissionContext permissionContext, @Nullable String argument, @Nonnull String userSearchName, int limit)
      Returns a set of ApplicationUsers represented by a security type instance optionally filtered by given userSearchName.

      The implementation must be as performant as possible and return users sorted by lowercase display name, then lowercase username.

      The default implementation is provided only not to break existing implementations and should be avoided at all cost.

      Parameters:
      permissionContext - the context this method is called in; contains issue and project
      argument - instance value, e.g. group name, username, custom field id
      userSearchName - query for user name; may be blank
      limit - maximum number of users to return
      Throws:
      IllegalArgumentException - if argument is invalid for this type.
      Since:
      9.12