Package dev.dsf.fhir.authorization
Class AbstractMetaTagAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource,D extends ResourceDao<R>>
java.lang.Object
dev.dsf.fhir.authorization.AbstractAuthorizationRule<R,D>
dev.dsf.fhir.authorization.AbstractMetaTagAuthorizationRule<R,D>
- All Implemented Interfaces:
AuthorizationRule<R>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
ActivityDefinitionAuthorizationRule,BinaryAuthorizationRule,BundleAuthorizationRule,CodeSystemAuthorizationRule,DocumentReferenceAuthorizationRule,EndpointAuthorizationRule,GroupAuthorizationRule,HealthcareServiceAuthorizationRule,LibraryAuthorizationRule,LocationAuthorizationRule,MeasureAuthorizationRule,MeasureReportAuthorizationRule,NamingSystemAuthorizationRule,OrganizationAffiliationAuthorizationRule,OrganizationAuthorizationRule,PatientAuthorizationRule,PractitionerAuthorizationRule,PractitionerRoleAuthorizationRule,ProvenanceAuthorizationRule,QuestionnaireAuthorizationRule,ResearchStudyAuthorizationRule,StructureDefinitionAuthorizationRule,SubscriptionAuthorizationRule,ValueSetAuthorizationRule
public abstract class AbstractMetaTagAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource,D extends ResourceDao<R>>
extends AbstractAuthorizationRule<R,D>
implements AuthorizationRule<R>, org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields inherited from class dev.dsf.fhir.authorization.AbstractAuthorizationRule
daoProvider, ORGANIZATION_IDENTIFIER_SYSTEM, organizationProvider, parameterConverter, readAccessHelper, referenceResolver, resourceType, serverBase -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMetaTagAuthorizationRule(Class<R> resourceType, DaoProvider daoProvider, String serverBase, ReferenceResolver referenceResolver, OrganizationProvider organizationProvider, ReadAccessHelper readAccessHelper, ParameterConverter parameterConverter) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanhasValidReadAccessTag(Connection connection, org.hl7.fhir.r4.model.Resource resource) protected abstract booleanmodificationsOk(Connection connection, R oldResource, R newResource) No need to check if the new resource is valid, will be checked bynewResourceOkForUpdate(Connection, Identity, Resource)newResourceOkForCreate(Connection connection, Identity identity, R newResource) newResourceOkForUpdate(Connection connection, Identity identity, R newResource) reasonCreateAllowed(Connection connection, Identity identity, R newResource) Override this method for non default behavior.reasonDeleteAllowed(Connection connection, Identity identity, R oldResource) Override this method for non default behavior.reasonReadAllowed(Connection connection, Identity identity, R existingResource) Override this method for non default behavior.reasonUpdateAllowed(Connection connection, Identity identity, R oldResource, R newResource) Override this method for non default behavior.protected abstract booleanresourceExists(Connection connection, R newResource) Methods inherited from class dev.dsf.fhir.authorization.AbstractAuthorizationRule
afterPropertiesSet, createIfLiteralInternalOrLogicalReference, getAffiliations, getDao, getResourceType, getResourceTypeName, isCurrentIdentityPartOfReferencedOrganization, isCurrentIdentityPartOfReferencedOrganizations, isCurrentIdentityPartOfReferencedOrganizations, isLocalOrganization, organizationWithIdentifierExists, reasonCreateAllowed, reasonDeleteAllowed, reasonHistoryAllowed, reasonPermanentDeleteAllowed, reasonPermanentDeleteAllowed, reasonReadAllowed, reasonSearchAllowed, reasonUpdateAllowed, resolveReference, roleExistsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.dsf.fhir.authorization.AuthorizationRule
getResourceType, reasonCreateAllowed, reasonDeleteAllowed, reasonHistoryAllowed, reasonPermanentDeleteAllowed, reasonPermanentDeleteAllowed, reasonReadAllowed, reasonSearchAllowed, reasonUpdateAllowedMethods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
-
Constructor Details
-
AbstractMetaTagAuthorizationRule
public AbstractMetaTagAuthorizationRule(Class<R> resourceType, DaoProvider daoProvider, String serverBase, ReferenceResolver referenceResolver, OrganizationProvider organizationProvider, ReadAccessHelper readAccessHelper, ParameterConverter parameterConverter)
-
-
Method Details
-
hasValidReadAccessTag
protected final boolean hasValidReadAccessTag(Connection connection, org.hl7.fhir.r4.model.Resource resource) -
reasonCreateAllowed
public final Optional<String> reasonCreateAllowed(Connection connection, Identity identity, R newResource) Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonCreateAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
connection- notnullidentity- notnullnewResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if create allowed
-
resourceExists
-
newResourceOkForCreate
protected abstract Optional<String> newResourceOkForCreate(Connection connection, Identity identity, R newResource) -
reasonReadAllowed
public final Optional<String> reasonReadAllowed(Connection connection, Identity identity, R existingResource) Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonReadAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
connection- notnullidentity- notnullexistingResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if read allowed
-
newResourceOkForUpdate
protected abstract Optional<String> newResourceOkForUpdate(Connection connection, Identity identity, R newResource) -
reasonUpdateAllowed
public final Optional<String> reasonUpdateAllowed(Connection connection, Identity identity, R oldResource, R newResource) Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonUpdateAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
connection- notnullidentity- notnulloldResource- notnullnewResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if update allowed
-
modificationsOk
No need to check if the new resource is valid, will be checked bynewResourceOkForUpdate(Connection, Identity, Resource)- Parameters:
connection- notnulloldResource- notnullnewResource- notnull- Returns:
trueif modifications from oldResource to newResource are ok
-
reasonDeleteAllowed
public final Optional<String> reasonDeleteAllowed(Connection connection, Identity identity, R oldResource) Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonDeleteAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
connection- notnullidentity- notnulloldResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if delete allowed
-