Class ContentRestrictionFactory
- java.lang.Object
-
- com.atlassian.confluence.api.impl.service.content.factory.ModelFactory<ContentPermissionSet,ContentRestriction>
-
- com.atlassian.confluence.api.impl.service.permissions.ContentRestrictionFactory
-
public class ContentRestrictionFactory extends ModelFactory<ContentPermissionSet,ContentRestriction>
ProducesContentRestriction
from providedContentPermissionSet
s- See Also:
ContentRestrictionService
-
-
Constructor Summary
Constructors Constructor Description ContentRestrictionFactory(PersonFactory personFactory, com.google.common.base.Supplier<ContentFactory> contentFactorySupplier, NavigationService navigationService)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ContentRestriction
buildFrom(@NonNull ContentPermissionSet set, LimitedRequest limitedRequest, Expansions expansions)
Produces aContentRestriction
from aContentPermissionSet
sContentRestriction
buildFrom(ContentPermissionSet hibernateObject, Expansions expansions)
static OperationKey
determineOpKey(String permissionType)
Given a raw ContentPermission type, return its corresponding OperationKey.static com.atlassian.fugue.Option<String>
determinePermissionType(OperationKey key)
Deprecated.since 6.5 useextractPermissionType(OperationKey)
static Optional<String>
extractPermissionType(OperationKey key)
Given an OperationKey, determine the raw ContentPermission type.static com.google.common.collect.ImmutableSet<OperationKey>
getSupportedOperationKeys()
Lists all recognizableOperationKey
s which can be accepted from the requests.-
Methods inherited from class com.atlassian.confluence.api.impl.service.content.factory.ModelFactory
asFunction, buildFrom
-
-
-
-
Constructor Detail
-
ContentRestrictionFactory
public ContentRestrictionFactory(PersonFactory personFactory, com.google.common.base.Supplier<ContentFactory> contentFactorySupplier, NavigationService navigationService)
-
-
Method Detail
-
buildFrom
public ContentRestriction buildFrom(@NonNull ContentPermissionSet set, LimitedRequest limitedRequest, Expansions expansions)
Produces aContentRestriction
from aContentPermissionSet
s
-
buildFrom
public ContentRestriction buildFrom(ContentPermissionSet hibernateObject, Expansions expansions)
- Specified by:
buildFrom
in classModelFactory<ContentPermissionSet,ContentRestriction>
-
determineOpKey
public static OperationKey determineOpKey(String permissionType)
Given a raw ContentPermission type, return its corresponding OperationKey. Pre-populated bi-directional map of allowed OperationKeys to ContentPermissions is stored inopKeyToPermissionBiMap
- Parameters:
permissionType
- the raw permission type for which to return the matching OperationKey- Returns:
- corresponding
OperationKey
(will be custom if not one of pre-defined)
-
determinePermissionType
@Deprecated public static com.atlassian.fugue.Option<String> determinePermissionType(OperationKey key)
Deprecated.since 6.5 useextractPermissionType(OperationKey)
Given an OperationKey, determine the raw ContentPermission type. Pre-populated bi-directional map of allowed OperationKeys to ContentPermissions is stored inopKeyToPermissionBiMap
- Parameters:
key
- the operation key for which to return the matching permission type- Returns:
- corresponding permission type inside an
Option
-
extractPermissionType
public static Optional<String> extractPermissionType(OperationKey key)
Given an OperationKey, determine the raw ContentPermission type. Pre-populated bi-directional map of allowed OperationKeys to ContentPermissions is stored inopKeyToPermissionBiMap
- Parameters:
key
- the operation key for which to return the matching permission type- Returns:
- corresponding permission type inside an
Option
- Since:
- 6.5.0
-
getSupportedOperationKeys
public static com.google.common.collect.ImmutableSet<OperationKey> getSupportedOperationKeys()
Lists all recognizableOperationKey
s which can be accepted from the requests. Pre-populated bi-directional map of allowed OperationKeys to ContentPermissions is stored inopKeyToPermissionBiMap
- Returns:
-
-