Class WikiAccessControlService

java.lang.Object
fr.paris.lutece.plugins.wiki.service.security.WikiAccessControlService

public final class WikiAccessControlService extends Object
Service for controlling access to wiki items based on user roles and permissions.
  • Field Details

  • 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 user
      item - the wiki item to check
      Returns:
      true if the user can view the item, false otherwise
    • canView

      public static boolean canView(WikiUserPermissions permissions, AbstractWikiItem item)
      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 user
      item - 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 user
      item - the wiki item to check
      Returns:
      true if the user can edit the item, false otherwise
    • canEdit

      public static boolean canEdit(WikiUserPermissions permissions, AbstractWikiItem item)
      Checks if the user can edit the specified wiki item, against already loaded permissions.
      Parameters:
      permissions - the permissions of the user
      item - the wiki item to check
      Returns:
      true if the user can edit the item, false otherwise
    • getAncestors

      public static List<AbstractWikiItem> getAncestors(AbstractWikiItem item)
      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