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 Details

    • userCanView

      boolean userCanView(@Nullable ApplicationUser remoteUser, @Nonnull Avatar icon)
      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

      boolean userCanDelete(@Nullable ApplicationUser remoteUser, @Nonnull Avatar icon)
      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 the IconType to determine permissions for icons that have not been created yet.