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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether the attachment list can be updated.abstract longgetAudienceId(String objectId) Retrieves the identity Id of the target audience for which the attachment will be accessibleabstract Stringabstract longgetSpaceId(String objectId) Retrieves the Space Id of the target space for which the attachment will be accessibleabstract booleanhasAccessPermission(org.exoplatform.services.security.Identity userIdentity, String entityId) Checks whether the user can access to an entityabstract booleanhasEditPermission(org.exoplatform.services.security.Identity userIdentity, String entityId) Checks whether the user can edit an entityMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Constructor Details
-
AttachmentPlugin
public AttachmentPlugin()
-
-
Method Details
-
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 identityentityId- 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 identityentityId- 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:
IdentityId 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:
SpaceId as long- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
canUpdateAttachmentList
public boolean canUpdateAttachmentList()Determines whether the attachment list can be updated.- Returns:
trueif the attachment list can be updated,falseotherwise.
-