Package com.atlassian.jira.mock
Class MockUserIconTypePolicy
java.lang.Object
com.atlassian.jira.plugin.icon.UserIconTypePolicy
com.atlassian.jira.mock.MockUserIconTypePolicy
- All Implemented Interfaces:
IconTypePolicy
-
Constructor Summary
ConstructorsConstructorDescriptionMockUserIconTypePolicy(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager) -
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.
-
Constructor Details
-
MockUserIconTypePolicy
public MockUserIconTypePolicy() -
MockUserIconTypePolicy
public MockUserIconTypePolicy(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager)
-
-
Method Details
-
userCanView
Description copied from interface:IconTypePolicyCheck if the user can view the icon.- Specified by:
userCanViewin interfaceIconTypePolicy- Overrides:
userCanViewin classUserIconTypePolicy- 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
Description copied from interface:IconTypePolicyCheck if the user can delete the icon.- Specified by:
userCanDeletein interfaceIconTypePolicy- Overrides:
userCanDeletein classUserIconTypePolicy- 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:IconTypePolicyCheck if the user could create an avatar for this owning object.- Specified by:
userCanCreateForin interfaceIconTypePolicy- Overrides:
userCanCreateForin classUserIconTypePolicy- 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.
-