public final class PrivilegeBits extends Object implements PrivilegeConstants
| Modifier and Type | Field and Description |
|---|---|
static Map<String,PrivilegeBits> |
BUILT_IN |
static PrivilegeBits |
EMPTY |
static PrivilegeBits |
NEXT_AFTER_BUILT_INS |
AGGREGATE_PRIVILEGES, JCR_ADD_CHILD_NODES, JCR_ALL, JCR_LIFECYCLE_MANAGEMENT, JCR_LOCK_MANAGEMENT, JCR_MODIFY_ACCESS_CONTROL, JCR_MODIFY_PROPERTIES, JCR_NAMESPACE_MANAGEMENT, JCR_NODE_TYPE_DEFINITION_MANAGEMENT, JCR_NODE_TYPE_MANAGEMENT, JCR_READ, JCR_READ_ACCESS_CONTROL, JCR_REMOVE_CHILD_NODES, JCR_REMOVE_NODE, JCR_RETENTION_MANAGEMENT, JCR_VERSION_MANAGEMENT, JCR_WORKSPACE_MANAGEMENT, JCR_WRITE, NON_AGGREGATE_PRIVILEGES, NT_REP_PRIVILEGE, NT_REP_PRIVILEGES, PRIVILEGE_NODETYPE_NAMES, PRIVILEGE_PROPERTY_NAMES, PRIVILEGES_PATH, REP_ADD_PROPERTIES, REP_AGGREGATES, REP_ALTER_PROPERTIES, REP_BITS, REP_INDEX_DEFINITION_MANAGEMENT, REP_IS_ABSTRACT, REP_NEXT, REP_PRIVILEGE_MANAGEMENT, REP_PRIVILEGES, REP_READ_NODES, REP_READ_PROPERTIES, REP_REMOVE_PROPERTIES, REP_USER_MANAGEMENT, REP_WRITE| Modifier and Type | Method and Description |
|---|---|
@NotNull PrivilegeBits |
add(@NotNull PrivilegeBits other)
Adds the other privilege bits to this instance.
|
@NotNull PrivilegeBits |
addDifference(@NotNull PrivilegeBits a,
@NotNull PrivilegeBits b)
Subtracts the
b from a and adds the result (diff)
to this instance. |
@NotNull org.apache.jackrabbit.oak.api.PropertyState |
asPropertyState(String name) |
static long |
calculatePermissions(@NotNull PrivilegeBits bits,
@NotNull PrivilegeBits parentBits,
boolean isAllow)
Calculate the granted permissions by evaluating the given privileges.
|
@NotNull PrivilegeBits |
diff(@NotNull PrivilegeBits other)
Subtracts the other PrivilegeBits from the this.
If the specified bits do not intersect with this, it isn't modified. If this is included in other empty
privilege bits is returned. |
boolean |
equals(Object o) |
static PrivilegeBits |
getInstance()
Creates a mutable instance of privilege bits.
|
static @NotNull PrivilegeBits |
getInstance(PrivilegeBits... base)
Creates a mutable instance of privilege bits.
|
static @NotNull PrivilegeBits |
getInstance(@Nullable org.apache.jackrabbit.oak.api.PropertyState property)
Get or create an instance of privilege bits for a specific property that
stores privileges.
|
static @NotNull PrivilegeBits |
getInstance(@Nullable org.apache.jackrabbit.oak.api.Tree tree)
Get or create an instance of privilege bits for a privilege definition.
|
int |
hashCode() |
boolean |
includes(@NotNull PrivilegeBits otherBits)
Returns
true if all privileges defined by the specified
otherBits are present in this instance. |
boolean |
isEmpty()
Returns
true if this privilege bits includes no privileges
at all. |
@NotNull PrivilegeBits |
modifiable() |
@NotNull PrivilegeBits |
nextBits()
Method to calculate the next privilege bits associated with this instance.
|
@NotNull PrivilegeBits |
retain(@NotNull PrivilegeBits other)
Retains the elements in this
PrivilegeBits that are contained in
the specified other PrivilegeBits. |
String |
toString() |
@NotNull PrivilegeBits |
unmodifiable()
Returns an unmodifiable instance.
|
void |
writeTo(@NotNull org.apache.jackrabbit.oak.api.Tree tree)
Write this instance as property to the specified tree.
|
public static final PrivilegeBits EMPTY
public static final Map<String,PrivilegeBits> BUILT_IN
public static final PrivilegeBits NEXT_AFTER_BUILT_INS
public static PrivilegeBits getInstance()
@NotNull public static @NotNull PrivilegeBits getInstance(@NotNull PrivilegeBits... base)
base - The base for this mutable instance.@NotNull public static @NotNull PrivilegeBits getInstance(@Nullable @Nullable org.apache.jackrabbit.oak.api.PropertyState property)
property - The property state storing privilege bits information.PrivilegeBits@NotNull public static @NotNull PrivilegeBits getInstance(@Nullable @Nullable org.apache.jackrabbit.oak.api.Tree tree)
tree - A privilege definition tree or the privileges root.PrivilegeBitspublic static long calculatePermissions(@NotNull
@NotNull PrivilegeBits bits,
@NotNull
@NotNull PrivilegeBits parentBits,
boolean isAllow)
bits - The set of privileges present at given tree.parentBits - The privileges present on the parent tree. These are
required in order to determine permissions that include a modification
of the parent tree (add_child_nodes, remove_child_nodes).isAllow - true if the privileges are granted; false
otherwise.public boolean isEmpty()
true if this privilege bits includes no privileges
at all.true if this privilege bits includes no privileges
at all; false otherwise.Permissions.NO_PERMISSION@NotNull public @NotNull PrivilegeBits unmodifiable()
PrivilegeBits instance.@NotNull public @NotNull PrivilegeBits modifiable()
public boolean includes(@NotNull
@NotNull PrivilegeBits otherBits)
true if all privileges defined by the specified
otherBits are present in this instance.otherBits - true if all privileges defined by the specified
otherBits are included in this instance; false
otherwise.@NotNull public @NotNull PrivilegeBits add(@NotNull @NotNull PrivilegeBits other)
other - The other privilege bits to be added.UnsupportedOperationException - if this instance is immutable.@NotNull public @NotNull PrivilegeBits diff(@NotNull @NotNull PrivilegeBits other)
this is included in other empty
privilege bits is returned.other - The other privilege bits to be subtracted from this instance.UnsupportedOperationException - if this instance is immutable.@NotNull public @NotNull PrivilegeBits addDifference(@NotNull @NotNull PrivilegeBits a, @NotNull @NotNull PrivilegeBits b)
b from a and adds the result (diff)
to this instance.a - An instance of privilege bits.b - An instance of privilege bits.UnsupportedOperationException - if this instance is immutable.@NotNull public @NotNull PrivilegeBits retain(@NotNull @NotNull PrivilegeBits other)
PrivilegeBits that are contained in
the specified other PrivilegeBits.other - Other privilege bits.other instance.@NotNull public @NotNull org.apache.jackrabbit.oak.api.PropertyState asPropertyState(String name)
@NotNull public @NotNull PrivilegeBits nextBits()
PrivilegeBitspublic void writeTo(@NotNull
@NotNull org.apache.jackrabbit.oak.api.Tree tree)
tree - The target tree.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.