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.
-
Constructor Summary
ConstructorsConstructorDescriptionSmartClinicalScope
(String thePrefix, String theResourceType, SmartPermissions thePerms, String theFilter) -
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.boolean
int
hashCode()
boolean
boolean
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()
-
Constructor Details
-
SmartClinicalScope
public SmartClinicalScope(@Nonnull String thePrefix, @Nonnull String theResourceType, @Nonnull SmartPermissions thePerms, @Nullable String theFilter)
-
-
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
-
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
-
getScopeString
-
equals
-
hashCode
-
hasSearch
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SmartClinicalScope>
-