Interface FavouriteManager
-
- All Known Implementing Classes:
DefaultFavouriteManager
public interface FavouriteManager
Manages the favourite spaces and pages of a user. A caller of this API has permission to add or remove a favourite if either: - The caller is the user that the favourite is added or removed on behalf of. - The caller is a confluence administrator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
isUserFavourite
boolean isUserFavourite(com.atlassian.user.User user, Space space)
Returns whether a space is marked as a favourite for a user.- Since:
- 5.9
-
hasPermission
boolean hasPermission(com.atlassian.user.User user, Space space)
Get whether the current user has permission to add or remove a space favourite.- Since:
- 5.9
-
addSpaceToFavourites
void addSpaceToFavourites(com.atlassian.user.User user, Space space) throws NotAuthorizedException, org.springframework.dao.DataAccessException
Add a space to a user's favourites by attaching a personal label to the space.- Parameters:
user
- The user to add the favourite on behalf of.space
- The space to add the favourite to.- Throws:
NotAuthorizedException
- If the current user doesn't have permission to add the favourite.org.springframework.dao.DataAccessException
- If the label save operation fails.- Since:
- 5.9
-
removeSpaceFromFavourites
void removeSpaceFromFavourites(com.atlassian.user.User user, Space space) throws NotAuthorizedException, org.springframework.dao.DataAccessException
Remove a space from a user's favourites.- Parameters:
user
- The user to remove the favourite on behalf of.space
- The space to remove the favourite from.- Throws:
NotAuthorizedException
- If the current user doesn't have permission to remove the favourite.org.springframework.dao.DataAccessException
- If the label delete operation fails.- Since:
- 5.9
-
isUserFavourite
boolean isUserFavourite(com.atlassian.user.User user, AbstractPage page)
Returns whether a page or blog post is marked as a favourite for a user.
-
hasPermission
boolean hasPermission(com.atlassian.user.User user, AbstractPage page)
Get whether the current user has permission to add or remove a page favourite.- Since:
- 5.9
-
addPageToFavourites
void addPageToFavourites(com.atlassian.user.User user, AbstractPage page) throws NotAuthorizedException, org.springframework.dao.DataAccessException
Add a page or blog post to a user's favourites by attaching a personal label to the space.- Parameters:
user
- The user to add the favourite on behalf of.space
- The space to add the favourite to.- Throws:
NotAuthorizedException
- Thrown if the current user doesn't have permission to add the favourite.org.springframework.dao.DataAccessException
- If the label save operation fails.
-
removePageFromFavourites
void removePageFromFavourites(com.atlassian.user.User user, AbstractPage page) throws NotAuthorizedException, org.springframework.dao.DataAccessException
Remove a page or blog post from a user's favourites.- Parameters:
user
- The user to remove the favourite on behalf of.space
- The space to remove the favourite from.- Throws:
NotAuthorizedException
- If the current user doesn't have permission to remove the favourite.org.springframework.dao.DataAccessException
- If the label delete operation fails.
-
-