public abstract class PermissionSubject extends Object implements Cloneable
PermissionSubject
is an abstraction used to specify which users a particular permission
is applicable to. All possible sub-classes of PermissionSubject
are listed in this class, and other implementation are not
supported because Structure needs to serialize and deserialize permission subjects.
Modifier and Type | Class and Description |
---|---|
static class |
PermissionSubject.Anyone
Represents "anyone", a subject that would match all users, even anonymous.
|
static class |
PermissionSubject.JiraGroup
Represents a specific group in JIRA, matching only the users that belong to that group.
|
static class |
PermissionSubject.JiraUser
Represents a specific user in JIRA, matching only that user.
|
static class |
PermissionSubject.ProjectRole
Represents a specific project role in a specific project, matching the users that belong to that project role
in that project.
|
static interface |
PermissionSubject.Visitor<T>
Used to visit specific subtypes of
PermissionSubject . |
Constructor and Description |
---|
PermissionSubject() |
Modifier and Type | Method and Description |
---|---|
PermissionSubject |
clone() |
static PermissionSubject |
clone(PermissionSubject owner) |
static PermissionSubject |
fromEncodedString(String s)
Creates a
PermissionSubject based on the string representation. |
static PermissionSubject |
fromEncodedString(String s,
boolean usersAsUserNames)
Creates a
PermissionSubject based on the string representation. |
abstract boolean |
matches(ApplicationUser user) |
abstract String |
toEncodedString() |
String |
toString() |
abstract <T> T |
visit(PermissionSubject.Visitor<T> visitor,
T carry)
Calls an appropriate visitor method, passing this PermissionSubject and the carry parameter.
|
public abstract boolean matches(@Nullable ApplicationUser user)
public abstract String toEncodedString()
fromEncodedString(java.lang.String)
@Nullable public static PermissionSubject fromEncodedString(@Nullable String s) throws ParseException
PermissionSubject
based on the string representation. Null parameter yields null result.
Use this method only if user keys were used to encode user permissions.s
- string representation of the PermissionSubjectParseException
- if s was not null neither empty, but the code failed to decipher the stringfromEncodedString(String, boolean)
@Nullable public static PermissionSubject fromEncodedString(@Nullable String s, boolean usersAsUserNames) throws ParseException
PermissionSubject
based on the string representation. Null parameter yields null result.s
- string representation of the PermissionSubjectusersAsUserNames
- true if user names were used to encode user permissions (Structure version was less than 2.3),
false if user keys were used instead.ParseException
- if s was not null neither empty, but the code failed to decipher the stringpublic PermissionSubject clone()
@Nullable public abstract <T> T visit(PermissionSubject.Visitor<T> visitor, @Nullable T carry)
@Nullable public static PermissionSubject clone(@Nullable PermissionSubject owner)
Copyright © 2024 Tempo Software. All Rights Reserved.