Class AttachmentPlugin

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.social.attachment.AttachmentPlugin
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public abstract class AttachmentPlugin extends org.exoplatform.container.component.BaseComponentPlugin
A plugin that will be used by AttachmentServiceImpl to check the edit and access permission of an attachment
  • Field Summary

    Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin

    desc, name
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract long
    Retrieves the identity Id of the target audience for which the attachment will be accessible
    abstract String
     
    abstract long
    getSpaceId(String objectId)
    Retrieves the Space Id of the target space for which the attachment will be accessible
    abstract boolean
    hasAccessPermission(org.exoplatform.services.security.Identity userIdentity, String entityId)
    Checks whether the user can access to an entity
    abstract boolean
    hasEditPermission(org.exoplatform.services.security.Identity userIdentity, String entityId)
    Checks whether the user can edit an entity

    Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

    getDescription, getName, setDescription, setName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AttachmentPlugin

      public AttachmentPlugin()
  • Method Details

    • getObjectType

      public abstract String getObjectType()
      Returns:
      entity types that plugin handles
    • hasAccessPermission

      public abstract boolean hasAccessPermission(org.exoplatform.services.security.Identity userIdentity, String entityId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Checks whether the user can access to an entity
      Parameters:
      userIdentity - user identity
      entityId - object technical unique identifier
      Returns:
      true if the user can access to an entity, else false.
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - thrown when the object doesn't exists
    • hasEditPermission

      public abstract boolean hasEditPermission(org.exoplatform.services.security.Identity userIdentity, String entityId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Checks whether the user can edit an entity
      Parameters:
      userIdentity - user identity
      entityId - object technical unique identifier
      Returns:
      true if the user can edit an entity, else false.
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - thrown when the object doesn't exists
    • getAudienceId

      public abstract long getAudienceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves the identity Id of the target audience for which the attachment will be accessible
      Parameters:
      objectId - Object Identifier
      Returns:
      Identity Id as long
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - thrown when the object doesn't exists
    • getSpaceId

      public abstract long getSpaceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Retrieves the Space Id of the target space for which the attachment will be accessible
      Parameters:
      objectId - Object Identifier
      Returns:
      Space Id as long
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - thrown when the object doesn't exists