Class ResourcePolicyRestRepository

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean, org.springframework.data.repository.CrudRepository<ResourcePolicyRest,​Integer>, org.springframework.data.repository.PagingAndSortingRepository<ResourcePolicyRest,​Integer>, org.springframework.data.repository.Repository<ResourcePolicyRest,​Integer>

    @Component("authz.resourcepolicy")
    public class ResourcePolicyRestRepository
    extends DSpaceRestRepository<ResourcePolicyRest,​Integer>
    implements org.springframework.beans.factory.InitializingBean
    Controller for exposition of default access condition
    Author:
    Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
    • Constructor Detail

      • ResourcePolicyRestRepository

        public ResourcePolicyRestRepository()
    • Method Detail

      • findAll

        @PreAuthorize("hasAuthority(\'AUTHENTICATED\')")
        public org.springframework.data.domain.Page<ResourcePolicyRest> findAll​(Context context,
                                                                                org.springframework.data.domain.Pageable pageable)
        Description copied from class: DSpaceRestRepository
        Method to implement to support scroll of entity instances from the collection resource endpoint
        Specified by:
        findAll in class DSpaceRestRepository<ResourcePolicyRest,​Integer>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • findByResource

        @PreAuthorize("hasPermission(#resourceUuid, \'dspaceObject\', \'ADMIN\')")
        public org.springframework.data.domain.Page<ResourcePolicyRest> findByResource​(UUID resourceUuid,
                                                                                       String action,
                                                                                       org.springframework.data.domain.Pageable pageable)
        Find the resource policies matching the uuid of the resource object and/or the specified action
        Parameters:
        resourceUuid - mandatory, the uuid of the resource object of the policy
        action - optional, limit the returned policies to the specified action
        pageable - contains the pagination information
        Returns:
        a Page of ResourcePolicyRest instances matching the uuid of the resource object and/or the specified action
      • findByEPerson

        @PreAuthorize("hasPermission(#epersonUuid, \'EPERSON\', \'READ\')")
        public org.springframework.data.domain.Page<ResourcePolicyRest> findByEPerson​(UUID epersonUuid,
                                                                                      UUID resourceUuid,
                                                                                      org.springframework.data.domain.Pageable pageable)
        Find the resource policies matching uuid of the eperson and/or the one specified resource object
        Parameters:
        epersonUuid - mandatory, the uuid of the eperson that benefit of the policy
        resourceUuid - optional, limit the returned policies to the ones related to the specified resource
        pageable - contains the pagination information
        Returns:
        It returns the list of explicit matching resource policies, no inherited or broader resource policies will be included in the list nor policies derived by groups' membership
      • findByGroup

        @PreAuthorize("hasPermission(#groupUuid, \'GROUP\', \'READ\')")
        public org.springframework.data.domain.Page<ResourcePolicyRest> findByGroup​(UUID groupUuid,
                                                                                    UUID resourceUuid,
                                                                                    org.springframework.data.domain.Pageable pageable)
        Find the resource policies matching uuid of the group and/or the ones specified resource object
        Parameters:
        groupUuid - mandatory, the uuid of the group that benefit of the policy
        resourceUuid - optional, limit the returned policies to the ones related to the specified resource
        pageable - contains the pagination information
        Returns:
        It returns the list of explicit matching resource policies, no inherited or broader resource policies will be included in the list nor policies derived by groups' membership
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception