Package ca.cdr.api.security
Class SmartClinicalScope
java.lang.Object
ca.cdr.api.security.SmartClinicalScope
Parsed smart scope for access to clinical data.
...
Only clinical scopes; not used for context, identity, or extension scopes.
-
Method Summary
Modifier and TypeMethodDescriptioncomputeNarrowedAuthority
(GrantedAuthorityJson theGrantedAuthorityJson) Compute the intersection of the authority and this scope.boolean
static Optional<SmartClinicalScope>
fromScopeString
(String theScope) Inspect the scope, and parse if it is a resource access scope.Get the (optional) filter from the scope.Get the permissions.Get the prefix.Get the resource scope.boolean
int
hashCode()
boolean
boolean
isImpliedBy
(SmartClinicalScope theOtherScope) boolean
isRead()
Do the permissions allow read.boolean
Is the resource scope "*".boolean
isWrite()
Do the permissions allow write.toString()
-
Method Details
-
fromScopeString
Inspect the scope, and parse if it is a resource access scope. e.g. "patient/*.read?code=foo" will parse, but "openid" will not.- Parameters:
theScope
- the requested scope- Returns:
- a parsed SmartClinicalScope if the scope affected resource access.
-
getPrefix
Get the prefix. E.g. "patient" from patient/Observation.read -
getResourceType
Get the resource scope. E.g. "Observation" from patient/Observation.read Can be "*" -
isStarType
Is the resource scope "*". E.g. patient/*.read?code=foo -
getPermissions
Get the permissions. E.g. "read" from patient/Observation.read Can be "*" -
isRead
Do the permissions allow read.- Returns:
- true for "read" or "*"
-
isWrite
Do the permissions allow write.- Returns:
- true for "write" or "*"
-
getFilter
Get the (optional) filter from the scope. E.g. "code=foo" from patient/*.read?code=foo -
hasFilter
-
computeNarrowedAuthority
@Nonnull public Optional<GrantedAuthorityJson> computeNarrowedAuthority(GrantedAuthorityJson theGrantedAuthorityJson) Compute the intersection of the authority and this scope. E.g. patient/Observation.read should narrow FHIR_READ_ALL to FHIR_READ_ALL_OF_TYPE/Observation. patient/Observation.read will narrow FHIR_READ_ALL_OF_TYPE/Patient to empty.- Parameters:
theGrantedAuthorityJson
- the users authority- Returns:
- the authority narrowed by this scope if applicable
-
isImpliedBy
-
toString
-
equals
-
hashCode
-
hasSearch
-