Package dev.cerbos.sdk
Class CheckResourceSetResult
- java.lang.Object
-
- dev.cerbos.sdk.CheckResourceSetResult
-
public class CheckResourceSetResult extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<CheckResult>get(java.lang.String resourceId)Get the check result for the given resource.java.util.Map<java.lang.String,CheckResult>getAll()Get all resources and their associated results.dev.cerbos.api.v1.response.Response.CheckResourceSetResponsegetRaw()booleanisAllowed(java.lang.String resourceId, java.lang.String action)Returns whether the given action can be performed on the given resource.
-
-
-
Method Detail
-
isAllowed
public boolean isAllowed(java.lang.String resourceId, java.lang.String action)Returns whether the given action can be performed on the given resource.- Parameters:
resourceId- ID of the resource to check.action- Action to check.- Returns:
- True if the action is allowed.
-
get
public java.util.Optional<CheckResult> get(java.lang.String resourceId)
Get the check result for the given resource.- Parameters:
resourceId- ID of the resource- Returns:
- A non-empty Optional containing
CheckResultif the resource exists in this RPC result.
-
getAll
public java.util.Map<java.lang.String,CheckResult> getAll()
Get all resources and their associated results.- Returns:
- Map of resource IDs to actions
-
getRaw
public dev.cerbos.api.v1.response.Response.CheckResourceSetResponse getRaw()
-
-