Class WikiAccessControlService
java.lang.Object
fr.paris.lutece.plugins.wiki.service.security.WikiAccessControlService
Service for controlling access to wiki items based on user roles and permissions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanCreateSpace(fr.paris.lutece.portal.service.security.LuteceUser user) Checks if the user can create a space.static booleancanEdit(WikiUserPermissions permissions, AbstractWikiItem item) Checks if the user can edit the specified wiki item, against already loaded permissions.static booleancanEdit(fr.paris.lutece.portal.service.security.LuteceUser user, AbstractWikiItem item) Checks if the user can edit the specified wiki item.static booleancanView(WikiUserPermissions permissions, AbstractWikiItem item) Checks if the user can view the specified wiki item, against already loaded permissions.static booleancanView(fr.paris.lutece.portal.service.security.LuteceUser user, AbstractWikiItem item) Checks if the user can view the specified wiki item.static List<AbstractWikiItem>getAncestors(AbstractWikiItem item) Returns the ancestors of an item, from the root to its direct parent.static booleanisWikiAdmin(fr.paris.lutece.portal.service.security.LuteceUser user) Checks if the user is a wiki admin.
-
Field Details
-
ROLE_WIKI_CREATE_SPACE
- See Also:
-
-
Method Details
-
canView
public static boolean canView(fr.paris.lutece.portal.service.security.LuteceUser user, AbstractWikiItem item) Checks if the user can view the specified wiki item.- Parameters:
user- the Lutece useritem- the wiki item to check- Returns:
- true if the user can view the item, false otherwise
-
canView
Checks if the user can view the specified wiki item, against already loaded permissions. Callers checking many items in a row should load the permissions once and use this method, so the permissions are read from the database only once.- Parameters:
permissions- the permissions of the useritem- the wiki item to check- Returns:
- true if the user can view the item, false otherwise
-
isWikiAdmin
public static boolean isWikiAdmin(fr.paris.lutece.portal.service.security.LuteceUser user) Checks if the user is a wiki admin.- Parameters:
user- the Lutece user- Returns:
- true if the user is a wiki admin, false otherwise
-
canCreateSpace
public static boolean canCreateSpace(fr.paris.lutece.portal.service.security.LuteceUser user) Checks if the user can create a space.- Parameters:
user- the Lutece user- Returns:
- true if the user can create a space, false otherwise
-
canEdit
public static boolean canEdit(fr.paris.lutece.portal.service.security.LuteceUser user, AbstractWikiItem item) Checks if the user can edit the specified wiki item.- Parameters:
user- the Lutece useritem- the wiki item to check- Returns:
- true if the user can edit the item, false otherwise
-
canEdit
Checks if the user can edit the specified wiki item, against already loaded permissions.- Parameters:
permissions- the permissions of the useritem- the wiki item to check- Returns:
- true if the user can edit the item, false otherwise
-
getAncestors
Returns the ancestors of an item, from the root to its direct parent.- Parameters:
item- the wiki item- Returns:
- the ancestors, empty for a root item
-