Class AccessPolicy
java.lang.Object
org.gcube.vremanagement.executor.rest.AccessPolicy
Who may do what on the Smart Executor, from the roles in the token of the caller.
- "SmartExecutor-Manager" in the Context, or "Infrastructure-Manager": launch, stop and remove tasks, and read every task of the Context;
- anybody else with a token of the Context: the list of the plugins, and the tasks and states of the tasks they launched.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic voidcheckCanRead(String ownerId) static voidstatic boolean
-
Field Details
-
SMART_EXECUTOR_MANAGER
The role of who manages the tasks of the Smart Executor in a Context.- See Also:
-
INFRASTRUCTURE_MANAGER
The role of who manages the whole infrastructure.- See Also:
-
MANAGER_ROLES
The roles that manage the tasks.
-
-
Method Details
-
isManager
public static boolean isManager()- Returns:
- whether the caller manages the tasks of the Context
-
checkManager
public static void checkManager()- Throws:
jakarta.ws.rs.ForbiddenException- if the caller does not manage the tasks of the Context
-
canRead
- Parameters:
ownerId- the identifier of who launched a task,nullwhen it is not known- Returns:
- whether the caller may read that task: a manager, or who launched it
-
checkCanRead
- Parameters:
ownerId- the identifier of who launched a task,nullwhen it is not known- Throws:
jakarta.ws.rs.ForbiddenException- if the caller may not read that task
-