Class QAEventSecurityServiceImpl

java.lang.Object
org.dspace.qaevent.service.impl.QAEventSecurityServiceImpl
All Implemented Interfaces:
QAEventSecurityService

public class QAEventSecurityServiceImpl extends Object implements QAEventSecurityService
Implementation of the security service for QAEvents. This implementation manages a configuration of QASecurity instances, each responsible for security checks for a specific QA source.
Author:
Mykhaylo Boychuk (mykhaylo.boychuk@4science.com)
  • Constructor Details

    • QAEventSecurityServiceImpl

      public QAEventSecurityServiceImpl()
  • Method Details

    • setQaSecurityConfiguration

      public void setQaSecurityConfiguration(Map<String,QASecurity> qaSecurityConfiguration)
    • setDefaultSecurity

      public void setDefaultSecurity(QASecurity defaultSecurity)
    • generateQAEventFilterQuery

      public Optional<String> generateQAEventFilterQuery(Context context, EPerson user, String qaSource)
      Description copied from interface: QAEventSecurityService
      Generate a query to restrict the qa events returned by other search/find method to the only ones visible to the specified user
      Specified by:
      generateQAEventFilterQuery in interface QAEventSecurityService
      Parameters:
      context - the context
      user - the eperson to consider
      qaSource - the source name
      Returns:
      the solr filter query
    • canSeeEvent

      public boolean canSeeEvent(Context context, EPerson user, QAEvent qaEvent)
      Description copied from interface: QAEventSecurityService
      Check if the specified user can see a specific QAEvent. It is expected that a QAEvent in a not visible QASource cannot be accessed. So implementation of this method should enforce this rule.
      Specified by:
      canSeeEvent in interface QAEventSecurityService
      Parameters:
      context - the context
      user - the eperson to consider
      qaEvent - the qaevent to check
      Returns:
      true if the specified user can see the specified event
    • canSeeSource

      public boolean canSeeSource(Context context, EPerson user, String qaSource)
      Description copied from interface: QAEventSecurityService
      Check if the specified user can see a specific QASource
      Specified by:
      canSeeSource in interface QAEventSecurityService
      Parameters:
      context - the context
      user - the eperson to consider
      qaSource - the source name
      Returns:
      true if the specified user can eventually see events in the QASource