Package com.atlassian.jira.bc.admin
Class ApplicationPropertiesServiceImpl
java.lang.Object
com.atlassian.jira.bc.admin.ApplicationPropertiesServiceImpl
- All Implemented Interfaces:
ApplicationPropertiesService
public class ApplicationPropertiesServiceImpl
extends Object
implements ApplicationPropertiesService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.bc.admin.ApplicationPropertiesService
ApplicationPropertiesService.EditPermissionLevel
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationPropertiesServiceImpl
(ApplicationPropertiesStore applicationPropertiesStore, com.atlassian.event.api.EventPublisher eventPublisher, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationPropertyChangeEvent
createEvent
(ApplicationPropertyMetadata metadata, String oldValue, String newValue) Retrieves a property with the given key.Retrieves all properties that can be edited by the user on the "General Configuration > Advanced Settings" page.getEditableApplicationProperties
(ApplicationPropertiesService.EditPermissionLevel permissionLevel, String keyFilter) Retrieves all properties that can be edited dynamically by the user.getEditableApplicationProperties
(String permissionLevel, String keyFilter) Retrieves all properties that can be edited dynamically by the user.boolean
Checks if the user has either ADMIN or SYSADMIN level permissions.boolean
hasPermissionForLevel
(String permissionLevel) Checks if the user has the permission to fetch values at the permissionLevel requested.setApplicationProperty
(String key, String value) Stores the given value for the given key in the underlying data store.
-
Constructor Details
-
ApplicationPropertiesServiceImpl
public ApplicationPropertiesServiceImpl(ApplicationPropertiesStore applicationPropertiesStore, com.atlassian.event.api.EventPublisher eventPublisher, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, FeatureManager featureManager)
-
-
Method Details
-
getEditableApplicationProperties
public List<ApplicationProperty> getEditableApplicationProperties(String permissionLevel, String keyFilter) Description copied from interface:ApplicationPropertiesService
Retrieves all properties that can be edited dynamically by the user.- Specified by:
getEditableApplicationProperties
in interfaceApplicationPropertiesService
- Parameters:
permissionLevel
- the level EditPermissionLevel as a string the all returned values should containkeyFilter
- may be null. Filter the list of properties by which keys start with keyFilter- Returns:
- the properties.
-
getEditableAdvancedProperties
Description copied from interface:ApplicationPropertiesService
Retrieves all properties that can be edited by the user on the "General Configuration > Advanced Settings" page.- Specified by:
getEditableAdvancedProperties
in interfaceApplicationPropertiesService
- Returns:
- the advanced properties.
- Throws:
DataAccessException
- if there is a problem with the backing store.
-
hasAdministrativePermissions
public boolean hasAdministrativePermissions()Checks if the user has either ADMIN or SYSADMIN level permissions.The implementation below calls only
isNormalAdmin()
as the SYSTEM_ADMIN has an implicit ADMINISTER privilege.- Specified by:
hasAdministrativePermissions
in interfaceApplicationPropertiesService
- Returns:
- true if the user has ADMIN or SYSADMIN level permissions.
-
hasPermissionForLevel
Description copied from interface:ApplicationPropertiesService
Checks if the user has the permission to fetch values at the permissionLevel requested.- Specified by:
hasPermissionForLevel
in interfaceApplicationPropertiesService
- Parameters:
permissionLevel
- the permission level. If blank, defaults the check for either ADMIN or SYSADMIN levels.- Returns:
- true if they are allowed the list
-
getEditableApplicationProperties
public List<ApplicationProperty> getEditableApplicationProperties(ApplicationPropertiesService.EditPermissionLevel permissionLevel, String keyFilter) throws DataAccessException Description copied from interface:ApplicationPropertiesService
Retrieves all properties that can be edited dynamically by the user.- Specified by:
getEditableApplicationProperties
in interfaceApplicationPropertiesService
- Parameters:
permissionLevel
- the level EditPermissionLevel as a string the all returned values should containkeyFilter
- may be null. Filter the list of properties by which keys start with keyFilter- Returns:
- the properties.
- Throws:
DataAccessException
- if there is a problem with the backing store.
-
getApplicationProperty
Description copied from interface:ApplicationPropertiesService
Retrieves a property with the given key.- Specified by:
getApplicationProperty
in interfaceApplicationPropertiesService
- Parameters:
key
- the property's key.- Returns:
- the property or null if there is no property with that key.
-
setApplicationProperty
Description copied from interface:ApplicationPropertiesService
Stores the given value for the given key in the underlying data store.- Specified by:
setApplicationProperty
in interfaceApplicationPropertiesService
- Parameters:
key
- the key.value
- the string representation of the value.- Returns:
- the property in full that corresponds to the new state of the property.
-
createEvent
protected ApplicationPropertyChangeEvent createEvent(ApplicationPropertyMetadata metadata, String oldValue, String newValue)
-