Class UsageReportRestPermissionEvaluatorPlugin

    • Constructor Detail

      • UsageReportRestPermissionEvaluatorPlugin

        public UsageReportRestPermissionEvaluatorPlugin()
    • Method Detail

      • hasDSpacePermission

        public boolean hasDSpacePermission​(org.springframework.security.core.Authentication authentication,
                                           Serializable targetId,
                                           String targetType,
                                           DSpaceRestPermission restPermission)
        Responsible for checking whether or not the user has used a valid request (valid UUID in /usagereports/{ UUID_ReportID} or in /usagereports/search/object?uri={uri-ending-in/UUID} and whether or not the used has the given (READ) rights on the corresponding DSO.
        Specified by:
        hasDSpacePermission in class RestObjectPermissionEvaluatorPlugin
        Parameters:
        targetType - usagereport or usagereportsearch, so we know how to extract the UUID
        targetId - string to extract uuid from
        authentication - Authentication object providing user details of the authenticated user
        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.