public class Features extends Object
Constructor and Description |
---|
Features() |
Modifier and Type | Method and Description |
---|---|
static void |
addFeatureForGroup(UserGroup group,
String feature,
UserI authenticatedUser)
Add feature for this group
|
static void |
banFeature(String feature)
Prevent this feature from being used on this server
|
static void |
blockByGroupType(String feature,
String displayName,
UserI authenticatedUser) |
static void |
blockFeatureForGroup(UserGroup group,
String feature,
UserI authenticatedUser)
Block feature for this group
|
static boolean |
checkFeature(UserGroup group,
String feature)
Check if group contains this feature
|
static boolean |
checkFeature(UserI user,
Collection<String> tags,
String feature)
Is this user a member of any groups with the matching tag and feature
|
static boolean |
checkFeature(UserI user,
String tag,
String feature)
Is this user a member of a group with the matching tag and feature
|
static boolean |
checkFeatureForAnyTag(UserI user,
String feature)
Is this user a member of any group with this feature
|
static void |
deleteAllFeaturesFromGroup(UserGroup group,
UserI authenticatedUser)
Remove all features from this group
|
static void |
deleteFeatureSettingFromGroup(UserGroup group,
String feature,
UserI authenticatedUser)
Remove feature from this group
|
static void |
disableByDefault(String feature)
Turn off this feature by default for all user groups
|
static void |
disableFeatureForGroup(UserGroup group,
String feature,
UserI authenticatedUser)
Enable feature for this group
|
static void |
disableIsOnByDefaultByGroupType(String feature,
String displayName,
UserI authenticatedUser) |
static void |
enableByDefault(String feature)
Turn on this feature by default for all user groups
|
static void |
enableFeatureForGroup(UserGroup group,
String feature,
UserI authenticatedUser)
Enable feature for this group
|
static void |
enableIsOnByDefaultByGroupType(String feature,
String displayName,
UserI authenticatedUser) |
static Collection<? extends FeatureDefinitionI> |
getAllFeatures() |
static Collection<String> |
getBannedFeatures() |
static Collection<String> |
getBannedFeaturesForGroupType(String type) |
static List<String> |
getBlockedFeaturesByTag(String tag) |
static Collection<String> |
getEnabledFeatures() |
static List<String> |
getEnabledFeaturesByTag(String tag) |
static Collection<String> |
getEnabledFeaturesForGroupType(String type) |
static FeatureRepositoryServiceI |
getFeatureRepositoryService()
Returns the currently configured features service
You can change the default implementation returned via the security.featureService.default configuration parameter
|
static FeatureServiceI |
getFeatureService()
Returns the currently configured features service
You can change the default implementation returned via the security.featureService.default configuration parameter
|
static Collection<String> |
getFeaturesForGroup(UserGroup group)
Get features for this group
|
static Collection<String> |
getFeaturesForUserByTag(UserI user,
String tag)
Retrieve a list of features for this user by tag
|
static Collection<String> |
getFeaturesForUserByTags(UserI user,
Collection<String> tags)
Retrieve a list of features for this user by tags
|
static Boolean |
isBanned(String feature)
Is this feature banned on the server
|
static boolean |
isBannedByGroup(UserGroup group,
String feature)
returns blocked setting for this feature for a group
|
static boolean |
isBlockedByGroupType(String feature,
String displayName)
returns default blocked setting for this feature for a given tag
|
static boolean |
isBlockedBySiteRole(String feature,
String role)
returns default blocked setting for this feature for a given role
|
static Boolean |
isOnByDefault(String feature)
Is this feature on by default for all users and groups
|
static boolean |
isOnByDefaultByGroup(UserGroup group,
String feature)
returns setting for this feature for a given group
|
static boolean |
isOnByDefaultByGroupType(String feature,
String displayName)
returns default setting for this feature for a given tag
|
static boolean |
isOnByDefaultBySiteRole(String feature,
String role)
returns default setting for this site wide role
|
static void |
unBanFeature(String feature)
Allow this feature to be used on this server
|
static void |
unblockByGroupType(String feature,
String displayName,
UserI authenticatedUser) |
static void |
unblockFeatureForGroup(UserGroup group,
String feature,
UserI authenticatedUser)
UnBlock feature for this group
|
public static final String SITE_WIDE
public static FeatureServiceI getFeatureService()
public static FeatureRepositoryServiceI getFeatureRepositoryService()
public static Collection<? extends FeatureDefinitionI> getAllFeatures()
public static Collection<String> getEnabledFeatures()
public static Collection<String> getBannedFeatures()
public static Collection<String> getEnabledFeaturesForGroupType(String type)
public static Collection<String> getBannedFeaturesForGroupType(String type)
public static Collection<String> getFeaturesForUserByTag(UserI user, String tag)
user
- public static Collection<String> getFeaturesForUserByTags(UserI user, Collection<String> tags)
user
- public static Collection<String> getFeaturesForGroup(UserGroup group)
group
- public static void addFeatureForGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void enableFeatureForGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void disableFeatureForGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void blockFeatureForGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void unblockFeatureForGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void deleteFeatureSettingFromGroup(UserGroup group, String feature, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static void deleteAllFeaturesFromGroup(UserGroup group, UserI authenticatedUser) throws Exception
group
- feature
- Exception
public static boolean checkFeature(UserGroup group, String feature)
group
- public static boolean checkFeatureForAnyTag(UserI user, String feature)
user
- feature
- public static boolean checkFeature(UserI user, String tag, String feature)
group
- public static boolean checkFeature(UserI user, Collection<String> tags, String feature)
group
- public static Boolean isBanned(String feature)
feature
- public static boolean isBlockedByGroupType(String feature, String displayName)
feature
- public static boolean isBannedByGroup(UserGroup group, String feature)
feature
- public static Boolean isOnByDefault(String feature)
feature
- public static boolean isOnByDefaultByGroupType(String feature, String displayName)
feature
- public static boolean isOnByDefaultByGroup(UserGroup group, String feature)
feature
- public static void banFeature(String feature)
feature
- public static void unBanFeature(String feature)
feature
- public static void enableByDefault(String feature)
feature
- public static void disableByDefault(String feature)
feature
- public static void blockByGroupType(String feature, String displayName, UserI authenticatedUser)
public static void unblockByGroupType(String feature, String displayName, UserI authenticatedUser)
public static void enableIsOnByDefaultByGroupType(String feature, String displayName, UserI authenticatedUser)
public static void disableIsOnByDefaultByGroupType(String feature, String displayName, UserI authenticatedUser)
public static boolean isOnByDefaultBySiteRole(String feature, String role)
feature
- Copyright © 2015 Neuroinformatics Research Group. All rights reserved.