public class DefaultFavouriteManager extends Object implements FavouriteManager
Constructor and Description |
---|
DefaultFavouriteManager(SpaceManager spaceManager,
LabelManager labelManager,
LabelPermissionEnforcer labelPermissionEnforcer) |
Modifier and Type | Method and Description |
---|---|
void |
addPageToFavourites(com.atlassian.user.User user,
AbstractPage page)
Add a page or blog post to a user's favourites by attaching a personal label to the space.
|
void |
addSpaceToFavourites(com.atlassian.user.User user,
Space space)
Add a space to a user's favourites by attaching a personal label to the space.
|
boolean |
hasPermission(com.atlassian.user.User user,
AbstractPage page)
Get whether the current user has permission to add or remove a page favourite.
|
boolean |
hasPermission(com.atlassian.user.User user,
Space space)
Get whether the current user has permission to add or remove a space favourite.
|
boolean |
isUserFavourite(com.atlassian.user.User user,
AbstractPage page)
Returns whether a page or blog post is marked as a favourite for a user.
|
boolean |
isUserFavourite(com.atlassian.user.User user,
Space space)
Returns whether a space is marked as a favourite for a user.
|
void |
removePageFromFavourites(com.atlassian.user.User user,
AbstractPage page)
Remove a page or blog post from a user's favourites.
|
void |
removeSpaceFromFavourites(com.atlassian.user.User user,
Space space)
Remove a space from a user's favourites.
|
public DefaultFavouriteManager(SpaceManager spaceManager, LabelManager labelManager, LabelPermissionEnforcer labelPermissionEnforcer)
public boolean isUserFavourite(com.atlassian.user.User user, Space space)
FavouriteManager
isUserFavourite
in interface FavouriteManager
public void addSpaceToFavourites(com.atlassian.user.User user, Space space) throws NotAuthorizedException, org.springframework.dao.DataAccessException
FavouriteManager
addSpaceToFavourites
in interface FavouriteManager
user
- The user to add the favourite on behalf of.space
- The space to add the favourite to.NotAuthorizedException
- If the current user doesn't have permission to add the favourite.org.springframework.dao.DataAccessException
- If the label save operation fails.public void removeSpaceFromFavourites(com.atlassian.user.User user, Space space) throws NotAuthorizedException, org.springframework.dao.DataAccessException
FavouriteManager
removeSpaceFromFavourites
in interface FavouriteManager
user
- The user to remove the favourite on behalf of.space
- The space to remove the favourite from.NotAuthorizedException
- If the current user doesn't have permission to remove the favourite.org.springframework.dao.DataAccessException
- If the label delete operation fails.public boolean isUserFavourite(com.atlassian.user.User user, AbstractPage page)
FavouriteManager
isUserFavourite
in interface FavouriteManager
public void addPageToFavourites(com.atlassian.user.User user, AbstractPage page) throws NotAuthorizedException, org.springframework.dao.DataAccessException
FavouriteManager
addPageToFavourites
in interface FavouriteManager
user
- The user to add the favourite on behalf of.NotAuthorizedException
- Thrown if the current user doesn't have permission to add the favourite.org.springframework.dao.DataAccessException
- If the label save operation fails.public void removePageFromFavourites(com.atlassian.user.User user, AbstractPage page) throws NotAuthorizedException, org.springframework.dao.DataAccessException
FavouriteManager
removePageFromFavourites
in interface FavouriteManager
user
- The user to remove the favourite on behalf of.NotAuthorizedException
- If the current user doesn't have permission to remove the favourite.org.springframework.dao.DataAccessException
- If the label delete operation fails.public boolean hasPermission(com.atlassian.user.User user, Space space)
FavouriteManager
hasPermission
in interface FavouriteManager
public boolean hasPermission(com.atlassian.user.User user, AbstractPage page)
FavouriteManager
hasPermission
in interface FavouriteManager
Copyright © 2003–2021 Atlassian. All rights reserved.