Package dev.dsf.fhir.authorization
Class AbstractAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource,D extends ResourceDao<R>>
java.lang.Object
dev.dsf.fhir.authorization.AbstractAuthorizationRule<R,D>
- All Implemented Interfaces:
AuthorizationRule<R>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractMetaTagAuthorizationRule,QuestionnaireResponseAuthorizationRule,TaskAuthorizationRule
public abstract class AbstractAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource,D extends ResourceDao<R>>
extends Object
implements AuthorizationRule<R>, org.springframework.beans.factory.InitializingBean
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DaoProviderprotected static final Stringprotected final OrganizationProviderprotected final ParameterConverterprotected final ReadAccessHelperprotected final ReferenceResolverprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAuthorizationRule(Class<R> resourceType, DaoProvider daoProvider, String serverBase, ReferenceResolver referenceResolver, OrganizationProvider organizationProvider, ReadAccessHelper readAccessHelper, ParameterConverter parameterConverter) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected final Optional<ResourceReference>createIfLiteralInternalOrLogicalReference(String referenceLocation, org.hl7.fhir.r4.model.Reference reference, Class<? extends org.hl7.fhir.r4.model.Resource>... referenceTypes) protected List<org.hl7.fhir.r4.model.OrganizationAffiliation>getAffiliations(Connection connection, String organizationIdentifierValue) protected final DgetDao()protected Stringprotected final booleanisCurrentIdentityPartOfReferencedOrganization(Connection connection, Identity identity, String referenceLocation, org.hl7.fhir.r4.model.Reference reference) protected final booleanisCurrentIdentityPartOfReferencedOrganizations(Connection connection, Identity identity, String referenceLocation, Collection<? extends org.hl7.fhir.r4.model.Reference> references) protected final booleanisCurrentIdentityPartOfReferencedOrganizations(Connection connection, Identity identity, String referenceLocation, Stream<? extends org.hl7.fhir.r4.model.Reference> references) protected final booleanisLocalOrganization(org.hl7.fhir.r4.model.Organization organization) protected final booleanorganizationWithIdentifierExists(Connection connection, org.hl7.fhir.r4.model.Identifier organizationIdentifier) reasonCreateAllowed(Identity identity, R newResource) Override this method for non default behavior.reasonDeleteAllowed(Identity identity, R oldResource) Override this method for non default behavior.reasonHistoryAllowed(Identity identity) Override this method for non default behavior.reasonPermanentDeleteAllowed(Identity identity, R oldResource) Override this method for non default behavior.reasonPermanentDeleteAllowed(Connection connection, Identity identity, R oldResource) Override this method for non default behavior.reasonReadAllowed(Identity identity, R existingResource) Override this method for non default behavior.reasonSearchAllowed(Identity identity) Override this method for non default behavior.reasonUpdateAllowed(Identity identity, R oldResource, R newResource) Override this method for non default behavior.protected final Optional<org.hl7.fhir.r4.model.Resource>resolveReference(Connection connection, Identity identity, Optional<ResourceReference> reference) protected final booleanroleExists(Connection connection, org.hl7.fhir.r4.model.Coding coding) Methods 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
reasonCreateAllowed, reasonDeleteAllowed, reasonReadAllowed, reasonUpdateAllowed
-
Field Details
-
ORGANIZATION_IDENTIFIER_SYSTEM
- See Also:
-
resourceType
-
daoProvider
-
serverBase
-
referenceResolver
-
organizationProvider
-
readAccessHelper
-
parameterConverter
-
-
Constructor Details
-
AbstractAuthorizationRule
public AbstractAuthorizationRule(Class<R> resourceType, DaoProvider daoProvider, String serverBase, ReferenceResolver referenceResolver, OrganizationProvider organizationProvider, ReadAccessHelper readAccessHelper, ParameterConverter parameterConverter)
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getResourceType
- Specified by:
getResourceTypein interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>
-
getResourceTypeName
-
getDao
-
reasonCreateAllowed
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:
identity- notnullnewResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if create allowed
-
reasonReadAllowed
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:
identity- notnullexistingResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if read allowed
-
getAffiliations
protected List<org.hl7.fhir.r4.model.OrganizationAffiliation> getAffiliations(Connection connection, String organizationIdentifierValue) -
reasonUpdateAllowed
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:
identity- notnulloldResource- notnullnewResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if update allowed
-
reasonDeleteAllowed
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:
identity- notnulloldResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if delete allowed
-
organizationWithIdentifierExists
protected final boolean organizationWithIdentifierExists(Connection connection, org.hl7.fhir.r4.model.Identifier organizationIdentifier) -
roleExists
-
isCurrentIdentityPartOfReferencedOrganizations
protected final boolean isCurrentIdentityPartOfReferencedOrganizations(Connection connection, Identity identity, String referenceLocation, Collection<? extends org.hl7.fhir.r4.model.Reference> references) -
isCurrentIdentityPartOfReferencedOrganizations
protected final boolean isCurrentIdentityPartOfReferencedOrganizations(Connection connection, Identity identity, String referenceLocation, Stream<? extends org.hl7.fhir.r4.model.Reference> references) -
isCurrentIdentityPartOfReferencedOrganization
protected final boolean isCurrentIdentityPartOfReferencedOrganization(Connection connection, Identity identity, String referenceLocation, org.hl7.fhir.r4.model.Reference reference) -
isLocalOrganization
protected final boolean isLocalOrganization(org.hl7.fhir.r4.model.Organization organization) -
createIfLiteralInternalOrLogicalReference
@SafeVarargs protected final Optional<ResourceReference> createIfLiteralInternalOrLogicalReference(String referenceLocation, org.hl7.fhir.r4.model.Reference reference, Class<? extends org.hl7.fhir.r4.model.Resource>... referenceTypes) -
resolveReference
protected final Optional<org.hl7.fhir.r4.model.Resource> resolveReference(Connection connection, Identity identity, Optional<ResourceReference> reference) -
reasonPermanentDeleteAllowed
Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonPermanentDeleteAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
identity- notnulloldResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if permanent delete allowed
-
reasonSearchAllowed
Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonSearchAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
identity- notnull- Returns:
- Reason as String in
Optional.of(Object)if delete allowed
-
reasonHistoryAllowed
Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonHistoryAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
identity- notnull- Returns:
- Reason as String in
Optional.of(Object)if delete allowed
-
reasonPermanentDeleteAllowed
public Optional<String> reasonPermanentDeleteAllowed(Connection connection, Identity identity, R oldResource) Description copied from interface:AuthorizationRuleOverride this method for non default behavior. Default: Not allowed.- Specified by:
reasonPermanentDeleteAllowedin interfaceAuthorizationRule<R extends org.hl7.fhir.r4.model.Resource>- Parameters:
connection- notnullidentity- notnulloldResource- notnull- Returns:
- Reason as String in
Optional.of(Object)if permanent delete allowed
-