Class JcrAllUtil
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.privilege.JcrAllUtil
-
public final class JcrAllUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static long
DYNAMIC_JCR_ALL_VALUE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertyState
asPropertyState(@NotNull java.lang.String name, @NotNull PrivilegeBits bits, @NotNull PrivilegeBitsProvider provider)
Returns a new multi-valuedPropertyState
of typeType.LONGS
with the givenname
and the long representation of the givenbits
as values.static boolean
denotesDynamicJcrAll(@Nullable PropertyState property)
static PrivilegeBits
getPrivilegeBits(@Nullable PropertyState propertyState, @NotNull PrivilegeBitsProvider provider)
Get or create an instance of privilege bits for the given property state.
-
-
-
Field Detail
-
DYNAMIC_JCR_ALL_VALUE
public static final long DYNAMIC_JCR_ALL_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getPrivilegeBits
public static PrivilegeBits getPrivilegeBits(@Nullable @Nullable PropertyState propertyState, @NotNull @NotNull PrivilegeBitsProvider provider)
Get or create an instance of privilege bits for the given property state. In contrast toPrivilegeBits.getInstance(PropertyState)
this implementation will respect the special marker used to reflect the dynamic nature of thePrivilegeConstants.JCR_ALL
privilege.- Parameters:
propertyState
- A property storing privilege bits asType.LONGS
representation or the dynamicmarker
forjcr:all
.provider
- An instanceofPrivilegeBitsProvider
to compute the bits for thePrivilegeConstants.JCR_ALL
, when the given property contains the dynamicmarker
forjcr:all
.- Returns:
- an instance of
PrivilegeBits
- See Also:
asPropertyState(String, PrivilegeBits, PrivilegeBitsProvider)
-
asPropertyState
public static PropertyState asPropertyState(@NotNull @NotNull java.lang.String name, @NotNull @NotNull PrivilegeBits bits, @NotNull @NotNull PrivilegeBitsProvider provider)
Returns a new multi-valuedPropertyState
of typeType.LONGS
with the givenname
and the long representation of the givenbits
as values. If the bits present includejcr:all
the value will beDYNAMIC_JCR_ALL_VALUE
instead to mark the dynamic nature of thejcr:all
privilege. For any other bits this method is equivalent toPrivilegeBits.asPropertyState(String)
.- Parameters:
name
- The name of the property to be created.bits
- The privilege bits from which the values will be retrieved.provider
- ThePrivilegeBitsProvider
needed to check if the given bits includejcr:all
.- Returns:
- The property state equivalent to
PrivilegeBits.asPropertyState(String)
or a state with thedynamic value marker
in case the given bits representjcr:all
.
-
denotesDynamicJcrAll
public static boolean denotesDynamicJcrAll(@Nullable @Nullable PropertyState property)
-
-