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 by BitstreamRestRepository.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 Details

  • Constructor Details

    • BitstreamMetadataReadPermissionEvaluatorPlugin

      public BitstreamMetadataReadPermissionEvaluatorPlugin()
  • Method Details

    • hasPermission

      public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission)
      Description copied from interface: RestPermissionEvaluatorPlugin
      Check in the authenticated user (provided by the Authentication object) has the specified permission on the target object with the provided identifier.
      Specified by:
      hasPermission in interface RestPermissionEvaluatorPlugin
      Overrides:
      hasPermission in class RestObjectPermissionEvaluatorPlugin
      Parameters:
      authentication - Authentication object providing user details of the authenticated user
      targetId - Unique identifier of the target object the user wants to view or manipulate
      targetType - Type of the target object the users wants to view or manipulate
      permission - 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(Context context, Bitstream bitstream) throws SQLException
      Throws:
      SQLException
    • hasDSpacePermission

      public boolean hasDSpacePermission(Authentication authentication, Serializable targetId, String targetType, DSpaceRestPermission restPermission)
      Description copied from class: RestObjectPermissionEvaluatorPlugin
      Plugins must implement this method to receive RestPermissionEvaluatorPlugin hasPermission requests.
      Specified by:
      hasDSpacePermission in class RestObjectPermissionEvaluatorPlugin
      Parameters:
      authentication - Authentication object providing user details of the authenticated user
      targetId - Unique identifier of the target object the user wants to view or manipulate
      targetType - Type of the target object the users wants to view or manipulate
      restPermission - 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.