Package com.atlassian.jira.permission
Class PermissionSchemeUtil
java.lang.Object
com.atlassian.jira.permission.PermissionSchemeUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.atlassian.fugue.Option<ProjectPermissionKey>
getPermissionKey
(SchemeEntity schemeEntity) Retrieves a permission key from a scheme entity'sentityTypeId
field.
-
Method Details
-
getPermissionKey
public static io.atlassian.fugue.Option<ProjectPermissionKey> getPermissionKey(SchemeEntity schemeEntity) Retrieves a permission key from a scheme entity'sentityTypeId
field.As
SchemeEntity
'sentityTypeId
field is of typeObject
there can be a lot of different things there. We accept and are able to process the following classes:- ProjectPermissionKey - returned verbatim
- String - literal permission key
- Long - we use
- Integer - we use
LegacyProjectPermissionKeyMapping
to resolve the keyLegacyProjectPermissionKeyMapping
to resolve the keyOption.none() is returned if
entityTypeId
if we couldn't find a legacy mapping from numeric value.- Returns:
- some project permission key if successful, none() otherwise
- Throws:
IllegalArgumentException
- whenentityTypeId
field is not a valid class.
-