Package org.dspace.app.rest.security
Class BitstreamMetadataReadPermissionEvaluatorPlugin
- java.lang.Object
-
- org.dspace.app.rest.security.RestObjectPermissionEvaluatorPlugin
-
- org.dspace.app.rest.security.BitstreamMetadataReadPermissionEvaluatorPlugin
-
- All Implemented Interfaces:
RestPermissionEvaluatorPlugin
@Component public class BitstreamMetadataReadPermissionEvaluatorPlugin extends RestObjectPermissionEvaluatorPlugin
Used byBitstreamRestRepository.findOne(Context, UUID)to get metadata of private bitstreams even though user can't access actual file- Author:
- Maria Verdonck (Atmire) on 15/06/2020
-
-
Field Summary
Fields Modifier and Type Field Description protected org.dspace.content.service.BitstreamServicebitstreamService
-
Constructor Summary
Constructors Constructor Description BitstreamMetadataReadPermissionEvaluatorPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasDSpacePermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, DSpaceRestPermission restPermission)Plugins must implement this method to receiveRestPermissionEvaluatorPluginhasPermission requests.booleanhasPermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, Object permission)Check in the authenticated user (provided by theAuthenticationobject) has the specified permission on the target object with the provided identifier.booleanmetadataReadPermissionOnBitstream(org.dspace.core.Context context, org.dspace.content.Bitstream bitstream)-
Methods inherited from class org.dspace.app.rest.security.RestObjectPermissionEvaluatorPlugin
hasPatchPermission, hasPermission
-
-
-
-
Method Detail
-
hasPermission
public boolean hasPermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, Object permission)Description copied from interface:RestPermissionEvaluatorPluginCheck in the authenticated user (provided by theAuthenticationobject) has the specified permission on the target object with the provided identifier.- Specified by:
hasPermissionin interfaceRestPermissionEvaluatorPlugin- Overrides:
hasPermissionin classRestObjectPermissionEvaluatorPlugin- Parameters:
authentication- Authentication object providing user details of the authenticated usertargetId- Unique identifier of the target object the user wants to view or manipulatetargetType- Type of the target object the users wants to view or manipulatepermission- Permission object that describes the action the user wants to perform on the target object- Returns:
- true if the user is allowed to perform the action described by the permission. False otherwise.
-
metadataReadPermissionOnBitstream
public boolean metadataReadPermissionOnBitstream(org.dspace.core.Context context, org.dspace.content.Bitstream bitstream) throws SQLException- Throws:
SQLException
-
hasDSpacePermission
public boolean hasDSpacePermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, DSpaceRestPermission restPermission)Description copied from class:RestObjectPermissionEvaluatorPluginPlugins must implement this method to receiveRestPermissionEvaluatorPluginhasPermission requests.- Specified by:
hasDSpacePermissionin classRestObjectPermissionEvaluatorPlugin- Parameters:
authentication- Authentication object providing user details of the authenticated usertargetId- Unique identifier of the target object the user wants to view or manipulatetargetType- Type of the target object the users wants to view or manipulaterestPermission- Permission object that describes the action the user wants to perform on the target object- Returns:
- true if the user is allowed to perform the action described by the permission. False otherwise.
-
-