Class PermissionSubject
Object
PermissionSubject
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
PermissionSubject.Anyone,PermissionSubject.JiraGroup,PermissionSubject.JiraUser,PermissionSubject.ProjectRole
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents "anyone", a subject that would match all users, even anonymous.static classRepresents a specific group in JIRA, matching only the users that belong to that group.static classRepresents a specific user in JIRA, matching only that user.static classRepresents a specific project role in a specific project, matching the users that belong to that project role in that project.static interfaceUsed to visit specific subtypes ofPermissionSubject. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static PermissionSubjectclone(PermissionSubject owner) static PermissionSubjectCreates aPermissionSubjectbased on the string representation.static PermissionSubjectfromEncodedString(String s, boolean usersAsUserNames) Creates aPermissionSubjectbased on the string representation.abstract booleanmatches(ApplicationUser user) abstract StringtoString()abstract <T> Tvisit(PermissionSubject.Visitor<T> visitor, T carry) Calls an appropriate visitor method, passing this PermissionSubject and the carry parameter.
-
Constructor Details
-
PermissionSubject
public PermissionSubject()
-
-
Method Details
-
matches
public abstract boolean matches(@Nullable ApplicationUser user) -
toEncodedString
- Returns:
- a string representation of this permission subject
- See Also:
-
fromEncodedString
@Nullable public static PermissionSubject fromEncodedString(@Nullable String s) throws ParseException Creates aPermissionSubjectbased on the string representation. Null parameter yields null result. Use this method only if user keys were used to encode user permissions.- Parameters:
s- string representation of the PermissionSubject- Returns:
- decoded PermissionSubject, or null if s was null or an empty string.
- Throws:
ParseException- if s was not null neither empty, but the code failed to decipher the string- See Also:
-
fromEncodedString
@Nullable public static PermissionSubject fromEncodedString(@Nullable String s, boolean usersAsUserNames) throws ParseException Creates aPermissionSubjectbased on the string representation. Null parameter yields null result.- Parameters:
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.- Returns:
- decoded PermissionSubject, or null if s was null or an empty string.
- Throws:
ParseException- if s was not null neither empty, but the code failed to decipher the string
-
clone
-
toString
-
visit
Calls an appropriate visitor method, passing this PermissionSubject and the carry parameter.- Returns:
- the result of the call
- Since:
- 7.2.0 (Structure 2.0)
-
clone
-