Interface PrivilegeSet
External representations, for example, when serialized as JSON, prefer composite privileges over individual ones. This means that if a privilege set contains all privileges included in a composite privilege, only the name of the composite privilege is serialized. If multiple composite privileges match, all matching ones are serialized.
This set of privileges natively represents only
individual privileges. To "collapse" those into composite privileges, use collapseComposites(Privileges).
Composite privileges can however be used as arguments to all contains() functions and
to the add()/remove() builder methods.
Do not use a PrivilegeSet when the special meaning of composite privileges
needs to be retained, especially during access checks.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncollapseComposites(Privileges privileges) booleanChecks whether the givenPrivilegeis fully contained in this privilege set.booleanbooleancontainsAll(Collection<?> c) Checks whether all of givenprivilegesis contained in this privilege set.booleancontainsAny(Iterable<? extends Privilege> privilege) Checks whether any of givenprivilegesis contained in this privilege set.static PrivilegeSetbooleanisEmpty()iterator(Privileges privileges) byte[]Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
emptyPrivilegeSet
-
contains
-
iterator
-
isEmpty
boolean isEmpty() -
toByteArray
byte[] toByteArray() -
collapseComposites
-
contains
Checks whether the givenPrivilegeis fully contained in this privilege set.For composite privileges, returns
trueif and only if all the individual privileges of a composite privilege are contained in this set. -
containsAll
Checks whether all of givenprivilegesis contained in this privilege set.For composite privileges, returns
trueif and only if all the individual privileges of a composite privilege are contained in this set.- Specified by:
containsAllin interfaceCollection<Privilege>- Specified by:
containsAllin interfaceSet<Privilege>
-
containsAny
Checks whether any of givenprivilegesis contained in this privilege set.For composite privileges, returns
trueif and only if all the individual privileges of a composite privilege are contained in this set.
-