Interface XWikiRightService

    • Method Detail

      • isSuperAdmin

        static boolean isSuperAdmin​(EntityReference userReference)
        Parameters:
        userReference - the user reference
        Returns:
        true if the passed reference belong to superadmin
        Since:
        9.2RC1
      • isGuest

        static boolean isGuest​(EntityReference userReference)
        Parameters:
        userReference - the user reference
        Returns:
        true if the passed reference belong to superadmin
        Since:
        9.2RC1
      • checkAccess

        boolean checkAccess​(String action,
                            XWikiDocument doc,
                            XWikiContext context)
                     throws XWikiException
        Checks if the wiki current user has the right to execute (@code action} on the document doc, along with redirecting to the login if it's not the case and there is no logged in user (the user is the guest user).
        Parameters:
        action - the action to be executed on the document
        doc - the document to perform action on
        context - the xwiki context in which to perform the verification (from which to get the user, for example)
        Returns:
        true if the user has right to execute action on doc, false otherwise and requests the login from the authentication service (redirecting to the login page in the case of a form authenticator, for example) when no user is logged in.
        Throws:
        XWikiException - if something goes wrong during the rights checking process
      • hasProgrammingRights

        @Deprecated
        boolean hasProgrammingRights​(XWikiContext context)
        Checks if the author of the context document (last editor of the content of the document) has programming rights (used to determine if the protected calls in the script contained in the document should be executed or not).
        Parameters:
        context - the xwiki context of this request
        Returns:
        true if the author of the context document has programming rights, false otherwise.
      • listAllLevels

        List<String> listAllLevels​(XWikiContext context)
                            throws XWikiException
        Parameters:
        context - the xwiki context of this request
        Returns:
        the list of all the known access levels
        Throws:
        XWikiException - if something goes wrong during the rights checking process