Class SecTasks
java.lang.Object
ch.tocco.nice2.persist.security.api.exec.SecTasks
-
Method Summary
Modifier and TypeMethodDescriptionstatic PersistTask
<Guard, Boolean> askPermission
(Permission... permission) Checks whether the guard grants all the given permissions.static PersistTask
<Guard, Boolean> askPermission
(String... permission) Checks whether the guard grants all the given permissions.static <A> PersistTask
<A, A> checkPermission
(Permission... permission) Returns a task that checks the given permissions against the guard of the entity and returns on successful authorization the same entity.static <A> PersistTask
<A, A> checkPermission
(String... permission) Returns a task that checks the given permissions against the guard of the entity and returns on successful authorization the same entity.static PersistTask
<Entity, Guard> Returns a task that finds the guard of an given entity.static PersistTask
<EntityManager, Guard> Returns a task that finds the guard of a given entity manager.static <A> PersistTask
<A, Guard> Returns a task that finds aGuard
for a given object.
-
Method Details
-
getGuardTask
Returns a task that finds aGuard
for a given object. -
getEntityGuard
Returns a task that finds the guard of an given entity. -
getEntityManagerGuard
Returns a task that finds the guard of a given entity manager. -
askPermission
Checks whether the guard grants all the given permissions. It returnstrue
on success andfalse
otherwise. If anull
guard is passed to the task, it will always return false. -
askPermission
Checks whether the guard grants all the given permissions. It returnstrue
on success andfalse
otherwise. If anull
guard is passed to the task, it will always return false. -
checkPermission
Returns a task that checks the given permissions against the guard of the entity and returns on successful authorization the same entity. If the check fails, an exception is thrown. -
checkPermission
Returns a task that checks the given permissions against the guard of the entity and returns on successful authorization the same entity. If the check fails, an exception is thrown.
-