Class MockUserIconTypePolicy

java.lang.Object
com.atlassian.jira.plugin.icon.UserIconTypePolicy
com.atlassian.jira.mock.MockUserIconTypePolicy
All Implemented Interfaces:
IconTypePolicy

public class MockUserIconTypePolicy extends UserIconTypePolicy implements IconTypePolicy
  • Constructor Details

  • Method Details

    • userCanView

      public boolean userCanView(@Nullable ApplicationUser remoteUser, @Nonnull Avatar icon)
      Description copied from interface: IconTypePolicy
      Check if the user can view the icon.
      Specified by:
      userCanView in interface IconTypePolicy
      Overrides:
      userCanView in class UserIconTypePolicy
      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

      public boolean userCanDelete(@Nullable ApplicationUser remoteUser, @Nonnull Avatar icon)
      Description copied from interface: IconTypePolicy
      Check if the user can delete the icon.
      Specified by:
      userCanDelete in interface IconTypePolicy
      Overrides:
      userCanDelete in class UserIconTypePolicy
      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

      public boolean userCanCreateFor(@Nullable ApplicationUser remoteUser, @Nonnull IconOwningObjectId owningObjectId)
      Description copied from interface: IconTypePolicy
      Check if the user could create an avatar for this owning object.
      Specified by:
      userCanCreateFor in interface IconTypePolicy
      Overrides:
      userCanCreateFor in class UserIconTypePolicy
      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.