Package com.atlassian.jira.plugin.icon
Interface IconTypePolicy
- All Known Implementing Classes:
IssueTypeIconTypePolicy,MockProjectIconTypePolicy,MockUserIconTypePolicy,ProjectIconTypePolicy,UserIconTypePolicy
@ExperimentalSpi
public interface IconTypePolicy
The IconTypePolicy defines the permissions around creating, deleting and viewing icons.
- Since:
- 7.1
-
Method Summary
Modifier and TypeMethodDescriptionbooleanuserCanCreateFor(ApplicationUser remoteUser, IconOwningObjectId owningObjectId) Check if the user could create an avatar for this owning object.booleanuserCanDelete(ApplicationUser remoteUser, Avatar icon) Check if the user can delete the icon.booleanuserCanView(ApplicationUser remoteUser, Avatar icon) Check if the user can view the icon.
-
Method Details
-
userCanView
Check if the user can view the icon.- Parameters:
remoteUser- user whose permissions should be used. Null means anonymous access.icon- The icon that the user wishes to access.- Returns:
- Returns true if the user is allowed to view the avatar, or false otherwise.
-
userCanDelete
Check if the user can delete the icon.- Parameters:
remoteUser- user whose permissions should be used. Null means anonymous access.icon- The icon that the user wishes to delete.- Returns:
- Returns true if the user is allowed to delete the avatar, or false otherwise.
-
userCanCreateFor
boolean userCanCreateFor(@Nullable ApplicationUser remoteUser, @Nonnull IconOwningObjectId owningObjectId) Check if the user could create an avatar for this owning object.- Parameters:
remoteUser- user whose permissions should be used. Null means anonymous access.owningObjectId- id of the object to which this avatar is connected to. This helps set the scope for the provider of theIconTypeto determine permissions for icons that have not been created yet.
-