Package ch.tocco.nice2.rest.entity.spi
Class SecurityUtils
java.lang.Object
ch.tocco.nice2.rest.entity.spi.SecurityUtils
This helper class provides static methods for simple security stuff.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasReadPermission(EntityReference entity, String field) Check if the current user is granted to read the given entity.static booleanhasWritePermission(EntityReference entity, String field) Check if the current user is granted to write to the given entity.
-
Method Details
-
hasReadPermission
Check if the current user is granted to read the given entity.- Parameters:
entity- the entity to check.- Returns:
- true if the user is granted to read the entity, else false.
-
hasWritePermission
Check if the current user is granted to write to the given entity.- Parameters:
entity- the entity to check.- Returns:
- true if the user is granted to write to the entity, else false.
-