Package com.atlassian.jira.permission
Interface PermissionSchemeAttributeManager
- All Known Implementing Classes:
DefaultPermissionSchemeAttributeManager
@ExperimentalApi
@ParametersAreNonnullByDefault
public interface PermissionSchemeAttributeManager
Allows managing permission scheme attributes.
- Since:
- 7.4
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAttributes(Long schemeId) Deletes all attributes from the permission scheme.voiddeleteAttributes(Long schemeId, Collection<String> keys) Deletes attributes with the defined keys from the permission scheme.getAttribute(Long schemeId, String key) Retrieves attribute value.getAttributes(Long schemeId) Retrieves all attributes for the given permission scheme (including default attributes).Default attributes are meant to exist even if there's no such attribute stored.voidsetAttribute(Long schemeId, String key, String value) Upserts an attribute for the given scheme.voidupdateAttributes(Long schemeId, Map<String, String> attributes) Updates ALL attributes for the permission scheme.
-
Method Details
-
getAttribute
Retrieves attribute value.- Parameters:
schemeId- permission scheme idkey- attribute key- Returns:
Optional<String>containing attribute value if it exists or default value if specified
Optional<String>#empty()if an attribute with the given key was not found for the given scheme and doesn't have specified default value
-
getAttributes
Retrieves all attributes for the given permission scheme (including default attributes).- Parameters:
schemeId- permission scheme id- Returns:
Map<String, String>of attributes' keys and values for the given permission scheme
-
setAttribute
Upserts an attribute for the given scheme.- Parameters:
schemeId- permission scheme idkey- attribute keyvalue- attribute value
-
updateAttributes
Updates ALL attributes for the permission scheme.- Parameters:
schemeId- permission scheme idattributes-Map<String, String>of all attributes the defined scheme should have, e.g. if this map doesn't contain an existing attribute, it would be deleted
-
deleteAttributes
Deletes attributes with the defined keys from the permission scheme.- Parameters:
schemeId- permission scheme idkeys- aCollection<String>of attribute keys
-
clearAttributes
Deletes all attributes from the permission scheme.- Parameters:
schemeId- permission scheme id
-
getDefaultAttributes
Default attributes are meant to exist even if there's no such attribute stored.- Returns:
Map<String, String>of default attributes' keys and values
-