Package com.atlassian.bamboo
Class DefaultDarkFeatureService
- java.lang.Object
-
- com.atlassian.bamboo.DefaultDarkFeatureService
-
- All Implemented Interfaces:
DarkFeatureService
public class DefaultDarkFeatureService extends Object implements DarkFeatureService
Facade forDarkFeatureManager
andFeatureManager
- Since:
- 5.9
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.DarkFeatureService
CREATE_DEPLOYMENT_GRANTED_BY_PROJECT, RSS_CREATE_RESULT_IF_NO_CHANGES, SOX_COMPLIANCE_CONFIGURABLE_KEY, VIEW_CONFIGURATION_PERMISSION_DISABLED
-
-
Constructor Summary
Constructors Constructor Description DefaultDarkFeatureService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disableFeatureForCurrentUser(String featureKey)
Disable a given feature for the current user.void
disableFeatureForUser(String featureKey, @NotNull com.atlassian.user.User user)
Disable a given feature for a given user.void
enableFeatureForCurrentUser(String featureKey)
Enable a given feature for the current user.void
enableFeatureForUser(String featureKey, @NotNull com.atlassian.user.User user)
Enable a given feature for a given user.boolean
isAtlassianAccountEnabled()
Whether user profiles are managed by Atlassian Accountboolean
isCloudExportEnabled()
Check if export for cloud is enabled (mainly view is available for users)boolean
isExperimentalRestAdminApiEnabled()
Always true.boolean
isFeatureForCurrentUserEnabled(@NotNull String featureKey)
Check whether a given feature key is enabled for the current user.boolean
isFeatureForUserEnabled(String featureKey, @NotNull com.atlassian.user.User user)
Check whether a given feature key is enabled for a given user.boolean
isImprovedAdminPanelNav()
Whether improved navigation in administration panel is enabled.boolean
isSimplifiedPlanConfigEnabled()
Check whether the simplified plan configuration is enabled.boolean
isViewConfigurationPermissionDisabled()
Is VIEW_CONFIGURATION permission disabled.
-
-
-
Method Detail
-
isCloudExportEnabled
public boolean isCloudExportEnabled()
Description copied from interface:DarkFeatureService
Check if export for cloud is enabled (mainly view is available for users)- Specified by:
isCloudExportEnabled
in interfaceDarkFeatureService
- Returns:
- is export for cloud enabled
-
isSimplifiedPlanConfigEnabled
public boolean isSimplifiedPlanConfigEnabled()
Description copied from interface:DarkFeatureService
Check whether the simplified plan configuration is enabled.- Specified by:
isSimplifiedPlanConfigEnabled
in interfaceDarkFeatureService
- Returns:
- is the simplified plan configuration enabled.
-
isExperimentalRestAdminApiEnabled
public boolean isExperimentalRestAdminApiEnabled()
Description copied from interface:DarkFeatureService
Always true.- Specified by:
isExperimentalRestAdminApiEnabled
in interfaceDarkFeatureService
-
isAtlassianAccountEnabled
public boolean isAtlassianAccountEnabled()
Description copied from interface:DarkFeatureService
Whether user profiles are managed by Atlassian Account- Specified by:
isAtlassianAccountEnabled
in interfaceDarkFeatureService
- Returns:
- is Atlassian Account enabled or not
-
isImprovedAdminPanelNav
public boolean isImprovedAdminPanelNav()
Description copied from interface:DarkFeatureService
Whether improved navigation in administration panel is enabled.- Specified by:
isImprovedAdminPanelNav
in interfaceDarkFeatureService
-
isViewConfigurationPermissionDisabled
public boolean isViewConfigurationPermissionDisabled()
Description copied from interface:DarkFeatureService
Is VIEW_CONFIGURATION permission disabled.- Specified by:
isViewConfigurationPermissionDisabled
in interfaceDarkFeatureService
-
enableFeatureForCurrentUser
public void enableFeatureForCurrentUser(String featureKey) throws IllegalArgumentException
Description copied from interface:DarkFeatureService
Enable a given feature for the current user.- Specified by:
enableFeatureForCurrentUser
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature key to be enabled.- Throws:
IllegalArgumentException
- if the current user is not logged in.
-
enableFeatureForUser
public void enableFeatureForUser(String featureKey, @NotNull @NotNull com.atlassian.user.User user) throws org.acegisecurity.AccessDeniedException
Description copied from interface:DarkFeatureService
Enable a given feature for a given user.- Specified by:
enableFeatureForUser
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature key to be enabled.user
- the user for which the feature should be enabled.- Throws:
org.acegisecurity.AccessDeniedException
- if the current user is not an admin.
-
disableFeatureForCurrentUser
public void disableFeatureForCurrentUser(String featureKey) throws IllegalArgumentException
Description copied from interface:DarkFeatureService
Disable a given feature for the current user.- Specified by:
disableFeatureForCurrentUser
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature key to be enabled.- Throws:
IllegalArgumentException
- if the current user is not logged in.
-
disableFeatureForUser
public void disableFeatureForUser(String featureKey, @NotNull @NotNull com.atlassian.user.User user) throws org.acegisecurity.AccessDeniedException
Description copied from interface:DarkFeatureService
Disable a given feature for a given user.- Specified by:
disableFeatureForUser
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature key to be disabled.user
- the user for which the feature should be disabled.- Throws:
org.acegisecurity.AccessDeniedException
- if the current user is not an admin.
-
isFeatureForUserEnabled
public boolean isFeatureForUserEnabled(String featureKey, @NotNull @NotNull com.atlassian.user.User user)
Description copied from interface:DarkFeatureService
Check whether a given feature key is enabled for a given user. Apart from checking whether the feature is enabled for the given user, this will also check site-wide enabled features.- Specified by:
isFeatureForUserEnabled
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature keyuser
- the user- Returns:
- whether the feature key is enabled for the given user.
-
isFeatureForCurrentUserEnabled
public boolean isFeatureForCurrentUserEnabled(@NotNull @NotNull String featureKey)
Description copied from interface:DarkFeatureService
Check whether a given feature key is enabled for the current user. Apart from checking whether the feature is enabled for the current user, this will also check site-wide enabled features.- Specified by:
isFeatureForCurrentUserEnabled
in interfaceDarkFeatureService
- Parameters:
featureKey
- the feature key- Returns:
- whether the feature key is enabled for the current user.
-
-