Class RightsManagerPluginApi
- java.lang.Object
-
- com.xpn.xwiki.api.Api
-
- com.xpn.xwiki.plugin.PluginApi<RightsManagerPlugin>
-
- com.xpn.xwiki.plugin.rightsmanager.RightsManagerPluginApi
-
public class RightsManagerPluginApi extends PluginApi<RightsManagerPlugin>
API for managing rights, users and groups.- Since:
- 1.1.2, 1.2M2
- Version:
- $Id: f98e4f71bc93b431de2168f60f6b309b87c82f8e $
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTEXT_LASTERRORCODE
Field name of the last error code inserted in context.static String
CONTEXT_LASTEXCEPTION
Field name of the last api exception inserted in context.protected static org.slf4j.Logger
LOGGER
The logging toolkit.
-
Constructor Summary
Constructors Constructor Description RightsManagerPluginApi(RightsManagerPlugin plugin, XWikiContext context)
Create an instance of the Rights Manager plugin user api.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
countAllGroupsNamesForMember(String member)
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadint
countAllMatchedMembersNamesForGroup(String group, String filter)
Filters the members of the specified group using the given text and counts the results.int
countAllMembersNamesForGroup(String group)
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadCollection<String>
getAllGroupsNamesForMember(String member)
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadCollection<String>
getAllMatchedMembersNamesForGroup(String group, String matchField, int nb, int start, Boolean orderAsc)
Get members of provided group.Collection<String>
getAllMembersNamesForGroup(String group)
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadCollection<String>
getAllMembersNamesForGroup(String group, int nb, int start)
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadRightsManagerGroupsApi
getGroupsApi()
RightsManagerRightsApi
getRightsApi()
RightsManagerUsersApi
getUsersApi()
-
Methods inherited from class com.xpn.xwiki.plugin.PluginApi
getInternalPlugin, getProtectedPlugin, setPlugin
-
Methods inherited from class com.xpn.xwiki.api.Api
convert, convert, convert, convertAttachments, getAuthorizationManager, getContextualAuthorizationManager, getXWikiContext, hasAccess, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights
-
-
-
-
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.
-
getUsersApi
public RightsManagerUsersApi getUsersApi()
- Returns:
- the API for managing users.
-
getGroupsApi
public RightsManagerGroupsApi getGroupsApi()
- Returns:
- the API for managing groups.
-
getAllGroupsNamesForMember
@Deprecated public Collection<String> getAllGroupsNamesForMember(String member) throws XWikiException
Deprecated.since 10.8RC1, use org.xwiki.user.script.GroupScriptService ($services.user.group) insteadGet all groups containing provided user.- Parameters:
member
- the name of the member (user or group).- Returns:
- the
Collection
ofString
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) insteadGet all members (users or groups) provided group contains.- Parameters:
group
- the name of the group.- Returns:
- the
Collection
ofString
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) insteadGet 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
ofString
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
ofString
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 countedfilter
- 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) insteadReturn 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) insteadReturn 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.
-
-