Package ca.cdr.api.security
Class SmartClinicalScope
java.lang.Object
ca.cdr.api.security.SmartClinicalScope
- All Implemented Interfaces:
Comparable<SmartClinicalScope>
Parsed smart scope for access to clinical data.
...
Only clinical scopes; not used for context, identity, or extension scopes.
-
Method Summary
Modifier and TypeMethodDescriptionint
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 prefix.Get the resource scope.Set<ca.cdr.api.security.SmartPermissions.SmartV2Permission>
boolean
int
hashCode()
boolean
boolean
hasV2Permission
(ca.cdr.api.security.SmartPermissions.SmartV2Permission read) Does the scope have the given V2 permission, or the equivalent from v1.boolean
isImpliedBy
(SmartClinicalScope theOtherScope) Is this scope implied by theOtherScope.boolean
Is the resource scope "*".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 -
getV2Permissions
-
hasV2Permission
Does the scope have the given V2 permission, or the equivalent from v1. -
getFilter
Get the (optional) filter from the scope. E.g. "code=foo" from patient/*.read?code=foo -
hasFilter
-
isImpliedBy
Is this scope implied by theOtherScope. We need to know if requested scopes are permitted by the registered allowed scopes. This isn't just simple string-set membership since the allowed scopes might be patient/*.read while the requested scope could be patient/Observation.read, or patient/Observation.r -
toString
-
equals
-
hashCode
-
hasSearch
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SmartClinicalScope>
-