Interface OpenMetadataAssetSecurity
- All Known Implementing Classes:
CocoPharmaSecretsSecurityConnector
,CocoPharmaServerSecurityConnector
public interface OpenMetadataAssetSecurity
OpenMetadataAssetSecurity is able to intercede as the zones are set up in an asset and
validates what a user is allowed to do with to Assets (often using the zone values).
The methods are given access to the whole asset to allow a variety of values to be tested.
-
Method Summary
Modifier and TypeMethodDescriptionsetAssetZonesToDefault
(List<String> defaultZones, Asset asset) Determine the appropriate setting for the asset zones depending on the content of the asset and the default zones.setSupportedZonesForUser
(List<String> supportedZones, String serviceName, String user) Determine the appropriate setting for the supported zones depending on the user and the default supported zones set up for the service.void
validateUserForAssetAttachmentUpdate
(String userId, Asset asset) Tests for whether a specific user should have the right to update elements attached directly to an asset such as schema and connections.void
validateUserForAssetCreate
(String userId, Asset asset) Tests for whether a specific user should have the right to create an asset.void
validateUserForAssetDelete
(String userId, Asset asset) Tests for whether a specific user should have the right to delete an asset.void
validateUserForAssetDetailUpdate
(String userId, Asset originalAsset, AssetAuditHeader originalAssetAuditHeader, Asset newAsset) Tests for whether a specific user should have the right to update an asset.void
validateUserForAssetFeedback
(String userId, Asset asset) Tests for whether a specific user should have the right to attach feedback - such as comments, ratings, tags and likes, to the asset.void
validateUserForAssetRead
(String userId, Asset asset) Tests for whether a specific user should have read access to a specific asset.verifyAssetZones
(List<String> defaultZones, List<String> supportedZones, List<String> publishZones, Asset originalAsset, Asset updatedAsset) Determine the appropriate setting for the asset zones depending on the content of the asset and the settings of both default zones and supported zones.
-
Method Details
-
setSupportedZonesForUser
List<String> setSupportedZonesForUser(List<String> supportedZones, String serviceName, String user) throws InvalidParameterException, PropertyServerException Determine the appropriate setting for the supported zones depending on the user and the default supported zones set up for the service. This is called whenever an asset is accessed.- Parameters:
supportedZones
- default setting of the supported zones for the serviceserviceName
- name of the called serviceuser
- name of the user- Returns:
- list of supported zones for the user
- Throws:
InvalidParameterException
- one of the parameter values is invalidPropertyServerException
- there is a problem calculating the zones
-
setAssetZonesToDefault
List<String> setAssetZonesToDefault(List<String> defaultZones, Asset asset) throws InvalidParameterException, PropertyServerException Determine the appropriate setting for the asset zones depending on the content of the asset and the default zones. This is called whenever a new asset is created.- Parameters:
defaultZones
- setting of the default zones for the serviceasset
- initial values for the asset- Returns:
- list of zones to set in the asset
- Throws:
InvalidParameterException
- one of the asset values is invalidPropertyServerException
- there is a problem calculating the zones
-
verifyAssetZones
List<String> verifyAssetZones(List<String> defaultZones, List<String> supportedZones, List<String> publishZones, Asset originalAsset, Asset updatedAsset) throws InvalidParameterException, PropertyServerException Determine the appropriate setting for the asset zones depending on the content of the asset and the settings of both default zones and supported zones. This method is called whenever an asset's values are changed.- Parameters:
defaultZones
- setting of the default zones for the servicesupportedZones
- setting of the supported zones for the servicepublishZones
- setting of the publish zones for the serviceoriginalAsset
- original values for the assetupdatedAsset
- updated values for the asset- Returns:
- list of zones to set in the asset
- Throws:
InvalidParameterException
- one of the asset values is invalidPropertyServerException
- there is a problem calculating the zones
-
validateUserForAssetCreate
Tests for whether a specific user should have the right to create an asset.- Parameters:
userId
- identifier of userasset
- new asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to change this asset
-
validateUserForAssetRead
Tests for whether a specific user should have read access to a specific asset.- Parameters:
userId
- identifier of userasset
- asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to access this asset
-
validateUserForAssetDetailUpdate
void validateUserForAssetDetailUpdate(String userId, Asset originalAsset, AssetAuditHeader originalAssetAuditHeader, Asset newAsset) throws UserNotAuthorizedException Tests for whether a specific user should have the right to update an asset. This is used for a general asset update, which may include changes to the zones and the ownership.- Parameters:
userId
- identifier of useroriginalAsset
- original asset detailsoriginalAssetAuditHeader
- details of the asset's audit headernewAsset
- new asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to change this asset
-
validateUserForAssetAttachmentUpdate
void validateUserForAssetAttachmentUpdate(String userId, Asset asset) throws UserNotAuthorizedException Tests for whether a specific user should have the right to update elements attached directly to an asset such as schema and connections.- Parameters:
userId
- identifier of userasset
- original asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to change this asset
-
validateUserForAssetFeedback
Tests for whether a specific user should have the right to attach feedback - such as comments, ratings, tags and likes, to the asset.- Parameters:
userId
- identifier of userasset
- original asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to change this asset
-
validateUserForAssetDelete
Tests for whether a specific user should have the right to delete an asset.- Parameters:
userId
- identifier of userasset
- original asset details- Throws:
UserNotAuthorizedException
- the user is not authorized to change this asset
-