@ExperimentalApi public interface

TypeAvatarService

com.atlassian.jira.avatar.TypeAvatarService
Known Indirect Subclasses

@ExperimentalApi

This interface is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

Interface to retrieve and create avatars of some type respecting the current JIRA permissions setup.

Summary

Public Methods
boolean canUserCreateAvatar(ApplicationUser remoteUser, String owningObjectId)
Return information if user can add avatar to given subject.
@Nonnull Avatar createAvatar(ApplicationUser remoteUser, String owningObjectId, AvatarImageDataProvider imageDataProvider)
Adds new avatar to given subject with provided image data - with permissions of given remote user.
@Nullable Avatar getAvatar(ApplicationUser remoteUser, long avatarId)
Return avatar using remote user permissions.
@Nonnull SystemAndCustomAvatars getAvatars(ApplicationUser remoteUser, String owningObjectId)
Get avatars assigned to given subject - with permissions of remote user.
@Nonnull Avatar getDefaultAvatar()
Get default avatar for current type.

Public Methods

public boolean canUserCreateAvatar (ApplicationUser remoteUser, String owningObjectId)

Return information if user can add avatar to given subject.

Parameters
remoteUser user whose permissions should be used
owningObjectId id of object (project/user/issuetype) to which this avatar is connected to

@Nonnull public Avatar createAvatar (ApplicationUser remoteUser, String owningObjectId, AvatarImageDataProvider imageDataProvider)

Adds new avatar to given subject with provided image data - with permissions of given remote user. Returns created avatar.

Parameters
remoteUser user whose permissions should be used
owningObjectId id of object (project/user/issuetype) to which this avatar will be connected to
imageDataProvider provider of image data for new avatar
Throws
IllegalAccessException if user cannot add avatar to given subject
IOException if there is error with image data

@Nullable public Avatar getAvatar (ApplicationUser remoteUser, long avatarId)

Return avatar using remote user permissions. May return null if user cannot access this avatar.

Parameters
remoteUser user whose permissions should be used
avatarId avatar id

@Nonnull public SystemAndCustomAvatars getAvatars (ApplicationUser remoteUser, String owningObjectId)

Get avatars assigned to given subject - with permissions of remote user.

Parameters
remoteUser user whose permissions should be used
owningObjectId id of object (project/user/issuetype) to which this avatar is connected to
Returns
  • object with all system and accessible by user custom avatars

@Nonnull public Avatar getDefaultAvatar ()

Get default avatar for current type. This avatar should be available to anyone