Class RightsManagerPluginApi


  • public class RightsManagerPluginApi
    extends PluginApi<RightsManagerPlugin>
    API for managing rights, users and groups.
    Since:
    1.1.2, 1.2M2
    Version:
    $Id: f98e4f71bc93b431de2168f60f6b309b87c82f8e $
    • Field Detail

      • CONTEXT_LASTERRORCODE

        public static final String CONTEXT_LASTERRORCODE
        Field name of the last error code inserted in context.
        See Also:
        Constant Field Values
      • CONTEXT_LASTEXCEPTION

        public static final String CONTEXT_LASTEXCEPTION
        Field name of the last api exception inserted in context.
        See Also:
        Constant Field Values
      • LOGGER

        protected static final org.slf4j.Logger LOGGER
        The logging toolkit.
    • Constructor Detail

      • RightsManagerPluginApi

        public RightsManagerPluginApi​(RightsManagerPlugin plugin,
                                      XWikiContext context)
        Create an instance of the Rights Manager plugin user api.
        Parameters:
        plugin - the entry point of the Rights Manager plugin.
        context - the XWiki context.
    • Method Detail

      • getRightsApi

        public RightsManagerRightsApi getRightsApi()
        Returns:
        the API for managing rights and inheritance.
      • getAllGroupsNamesForMember

        @Deprecated
        public Collection<String> getAllGroupsNamesForMember​(String member)
                                                      throws XWikiException
        Deprecated.
        since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) instead
        Get all groups containing provided user.
        Parameters:
        member - the name of the member (user or group).
        Returns:
        the Collection of String containing group name.
        Throws:
        XWikiException - error when browsing groups.
      • getAllMembersNamesForGroup

        @Deprecated
        public Collection<String> getAllMembersNamesForGroup​(String group)
                                                      throws XWikiException
        Deprecated.
        since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) instead
        Get all members (users or groups) provided group contains.
        Parameters:
        group - the name of the group.
        Returns:
        the Collection of String containing member (user or group) name.
        Throws:
        XWikiException - error when browsing groups.
      • getAllMembersNamesForGroup

        @Deprecated
        public Collection<String> getAllMembersNamesForGroup​(String group,
                                                             int nb,
                                                             int start)
                                                      throws XWikiException
        Deprecated.
        since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) instead
        Get all members (users or groups) provided group contains.
        Parameters:
        group - the name of the group.
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        Returns:
        the Collection of String containing member (user or group) name.
        Throws:
        XWikiException - error when browsing groups.
      • getAllMatchedMembersNamesForGroup

        public Collection<String> getAllMatchedMembersNamesForGroup​(String group,
                                                                    String matchField,
                                                                    int nb,
                                                                    int start,
                                                                    Boolean orderAsc)
                                                             throws XWikiException
        Get members of provided group.
        Parameters:
        group - the group.
        matchField - a string to search in result to filter.
        nb - the maximum number of result to return.
        start - the index of the first found user to return.
        orderAsc - if true, the result is ordered ascendent, if false it descendant. If null no order is applied.
        Returns:
        the Collection of String containing member name.
        Throws:
        XWikiException - error when browsing groups.
        Since:
        1.6M1
      • countAllMatchedMembersNamesForGroup

        public int countAllMatchedMembersNamesForGroup​(String group,
                                                       String filter)
        Filters the members of the specified group using the given text and counts the results.
        Parameters:
        group - the group whose members are going to be counted
        filter - the text used to filter the group members
        Returns:
        the number of group members that match the given text filter
        Since:
        10.8RC1
        See Also:
        getAllMatchedMembersNamesForGroup(String, String, int, int, Boolean)
      • countAllGroupsNamesForMember

        @Deprecated
        public int countAllGroupsNamesForMember​(String member)
                                         throws XWikiException
        Deprecated.
        since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) instead
        Return the number of groups containing provided member.
        Parameters:
        member - the name of the member (user or group).
        Returns:
        the number of groups.
        Throws:
        XWikiException - error when getting number of users.
      • countAllMembersNamesForGroup

        @Deprecated
        public int countAllMembersNamesForGroup​(String group)
                                         throws XWikiException
        Deprecated.
        since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) instead
        Return the number of members provided group contains.
        Parameters:
        group - the name of the group.
        Returns:
        the number of members.
        Throws:
        XWikiException - error when getting number of groups.