Package com.atlassian.jira.mock
Class MockProjectIconTypePolicy
java.lang.Object
com.atlassian.jira.plugin.icon.ProjectIconTypePolicy
com.atlassian.jira.mock.MockProjectIconTypePolicy
- All Implemented Interfaces:
IconTypePolicy
-
Constructor Summary
ConstructorsConstructorDescriptionMockProjectIconTypePolicy(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, ProjectService projectService, ProjectManager projectManager) -
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
-
MockProjectIconTypePolicy
public MockProjectIconTypePolicy() -
MockProjectIconTypePolicy
public MockProjectIconTypePolicy(GlobalPermissionManager globalPermissionManager, PermissionManager permissionManager, ProjectService projectService, ProjectManager projectManager)
-
-
Method Details
-
userCanView
Description copied from interface:IconTypePolicyCheck if the user can view the icon.- Specified by:
userCanViewin interfaceIconTypePolicy- Overrides:
userCanViewin classProjectIconTypePolicy- 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 classProjectIconTypePolicy- 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 classProjectIconTypePolicy- 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.
-