|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.plugin.rightsmanager.RightsManager
public final class RightsManager
Hidden toolkit used by the plugin API that make all the plugin's actions.
Field Summary | |
---|---|
static String |
DEFAULT_USERORGROUP_SPACE
Name of the default space where users and groups are stored. |
Method Summary | |
---|---|
int |
countAllGlobalUsersOrGroups(boolean user,
Object[][] matchFields,
XWikiContext context)
Get the number of users or groups in the main wiki. |
int |
countAllGroupsNamesForMember(String member,
XWikiContext context)
Return the number of groups containing provided member. |
int |
countAllLocalUsersOrGroups(boolean user,
Object[][] matchFields,
XWikiContext context)
Get the number of users or groups in the current wiki. |
int |
countAllMembersNamesForGroup(String group,
XWikiContext context)
Return the number of members provided group contains. |
int |
countAllUsersOrGroups(boolean user,
Object[][] matchFields,
XWikiContext context)
Get the number of users or groups in the main wiki and the current wiki. |
int |
countAllWikiUsersOrGroups(boolean user,
String wikiName,
Object[][] matchFields,
XWikiContext context)
Get the number of users or groups in the provided wiki. |
Collection<String> |
getAllGroupsNamesForMember(String member,
int nb,
int start,
XWikiContext context)
Get all groups containing provided user. |
List<?> |
getAllMatchedGlobalUsersOrGroups(boolean user,
Object[][] matchFields,
boolean withdetails,
RequestLimit limit,
Object[][] order,
XWikiContext context)
Get all users or groups in the main wiki. |
List<?> |
getAllMatchedLocalUsersOrGroups(boolean user,
Object[][] matchFields,
boolean withdetails,
RequestLimit limit,
Object[][] order,
XWikiContext context)
Get all users or groups in the current wiki. |
Collection<String> |
getAllMatchedMembersNamesForGroup(String group,
String matchField,
int nb,
int start,
Boolean orderAsc,
XWikiContext context)
Get members of provided group. |
List<?> |
getAllMatchedUsersOrGroups(boolean user,
Object[][] matchFields,
boolean withdetails,
RequestLimit limit,
Object[][] order,
XWikiContext context)
Get all users or groups in the main wiki and the current. |
List<?> |
getAllMatchedWikiUsersOrGroups(boolean user,
String wikiName,
Object[][] matchFields,
boolean withdetails,
RequestLimit limit,
Object[][] order,
XWikiContext context)
Get all users or groups in the provided wiki. |
Collection<String> |
getAllMembersNamesForGroup(String group,
int nb,
int start,
XWikiContext context)
Get all users provided group contains. |
static RightsManager |
getInstance()
|
Map<String,LevelTree> |
getLevelTreeMap(String spaceOrPage,
List<String> levelsToMatch,
XWikiContext context)
Get the LevelTree Map for he provided rights levels. |
XWikiDocument |
getParentPreference(String spaceOrPage,
XWikiContext context)
Get the document containing inherited rights of provided document. |
XWikiDocument |
getParentPreference(XWikiDocument currentPreference,
boolean currentGlobal,
XWikiContext context)
Get the document containing inherited rights of provided document. |
LevelTree |
getTreeLevel(String spaceOrPage,
String levelName,
XWikiContext context)
Get level right tree. |
boolean |
groupContainsMember(String groupName,
String memberName,
Map<String,Collection<String>> groupCacheIn,
XWikiContext context)
Browse a group and groups it contains to find provided member (user or group). |
void |
removeDirectRights(String spaceOrPage,
List<String> levelNames,
String comment,
XWikiContext context)
Remove "direct" rights for wiki, space or document. |
void |
removeUserOrGroupFromAllRights(String userOrGroupWiki,
String userOrGroupSpace,
String userOrGroupName,
boolean user,
XWikiContext context)
Remove all references to provided user or group from all rights documents. |
boolean |
removeUserOrGroupFromAllRights(XWikiDocument rightsDocument,
String userOrGroupWiki,
String userOrGroupSpace,
String userOrGroupName,
boolean user,
XWikiContext context)
Remove all references to provided user or group from provided rights document. |
void |
removeUserOrGroupFromLevel(String spaceOrPage,
String userOrGroup,
boolean user,
String levelName,
boolean allow,
String comment,
XWikiContext context)
Remove a user or group from rights preferences document for provided level. |
boolean |
removeUserOrGroupFromRight(BaseObject right,
String userOrGroupWiki,
String userOrGroupSpace,
String userOrGroupName,
boolean user,
XWikiContext context)
Remove all references to provided user or group from provided right object. |
boolean |
removeUserOrGroupFromRights(XWikiDocument rightsDocument,
String userOrGroupWiki,
String userOrGroupSpace,
String userOrGroupName,
boolean user,
boolean global,
XWikiContext context)
Remove all references to provided user or group from provided rights document. |
Collection<DocumentReference> |
resolveUsers(DocumentReference userOrGroup,
XWikiContext context)
Resolve passed user or group into users references list. |
Collection<DocumentReference> |
resolveUsers(List<String> referenceList,
XWikiContext context)
Resolve passed users and groups into users references list. |
Collection<DocumentReference> |
resolveUsers(String userOrGroup,
XWikiContext context)
Resolve passed user or group into users references list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_USERORGROUP_SPACE
Method Detail |
---|
public static RightsManager getInstance()
public int countAllUsersOrGroups(boolean user, Object[][] matchFields, XWikiContext context) throws XWikiException
user
- indicate if methods search for users or groups.matchFields
- the field to math with values. It is a table of table with :
context
- the XWiki context.
XWikiException
- error when getting number of users or groups.public int countAllWikiUsersOrGroups(boolean user, String wikiName, Object[][] matchFields, XWikiContext context) throws XWikiException
user
- indicate if methods search for users or groups.wikiName
- the name of the wiki where to search for users or groups.matchFields
- the field to math with values. It is a table of table with :
context
- the XWiki context.
XWikiException
- error when getting number of users or groups.public int countAllGlobalUsersOrGroups(boolean user, Object[][] matchFields, XWikiContext context) throws XWikiException
user
- indicate if methods search for users or groups.matchFields
- the field to math with values. It is a table of table with :
context
- the XWiki context.
XWikiException
- error when getting number of users or groups.public int countAllLocalUsersOrGroups(boolean user, Object[][] matchFields, XWikiContext context) throws XWikiException
user
- indicate if methods search for users or groups.matchFields
- the field to math with values. It is a table of table with :
context
- the XWiki context.
XWikiException
- error when getting number of users or groups.public List<?> getAllMatchedUsersOrGroups(boolean user, Object[][] matchFields, boolean withdetails, RequestLimit limit, Object[][] order, XWikiContext context) throws XWikiException
user
- indicate if it is a user or a group.matchFields
- the field to math with values. It is a table of table with :
withdetails
- indicate if the methods return List
or String
or List
of
XWikiDocument
.limit
- the maximum number of result to return and index of the first element.order
- the fields to order from. It is a table of table with :
context
- the XWiki context.
List
of String
containing user or group name if withdetails
is false,
otherwise a List
of XWikiDocument
containing user or group.
XWikiException
- error when searching from users or groups.public List<?> getAllMatchedGlobalUsersOrGroups(boolean user, Object[][] matchFields, boolean withdetails, RequestLimit limit, Object[][] order, XWikiContext context) throws XWikiException
user
- indicate if it is a user or a group.matchFields
- the field to math with values. It is a table of table with :
withdetails
- indicate if the methods return List
or String
or List
of
XWikiDocument
.limit
- the maximum number of result to return and index of the first element.order
- the fields to order from. It is a table of table with :
context
- the XWiki context.
List
of String
containing user or group name if withdetails
is false,
otherwise a List
of XWikiDocument
containing user or group.
XWikiException
- error when searching from users or groups.public List<?> getAllMatchedWikiUsersOrGroups(boolean user, String wikiName, Object[][] matchFields, boolean withdetails, RequestLimit limit, Object[][] order, XWikiContext context) throws XWikiException
user
- indicate if it is a user or a group.wikiName
- the name of the wiki where to search.matchFields
- the field to math with values. It is a table of table with :
withdetails
- indicate if the methods return List
or String
or List
of
XWikiDocument
.limit
- the maximum number of result to return and index of the first element.order
- the fields to order from. It is a table of table with :
context
- the XWiki context.
List
of String
containing user or group name if withdetails
is false,
otherwise a List
of XWikiDocument
containing user or group.
XWikiException
- error when searching from users or groups.public List<?> getAllMatchedLocalUsersOrGroups(boolean user, Object[][] matchFields, boolean withdetails, RequestLimit limit, Object[][] order, XWikiContext context) throws XWikiException
user
- indicate if it is a user or a group.matchFields
- the field to math with values. It is a table of table with :
withdetails
- indicate if the methods return List
or String
or List
of
XWikiDocument
.limit
- the maximum number of result to return and index of the first element.order
- the fields to order from. It is a table of table with :
context
- the XWiki context.
List
of String
containing user or group name if withdetails
is false,
otherwise a List
of XWikiDocument
containing user or group.
XWikiException
- error when searching from users or groups.public Collection<String> getAllGroupsNamesForMember(String member, int nb, int start, XWikiContext context) throws XWikiException
member
- the name of the member (user or group).nb
- the maximum number of result to return.start
- the index of the first found member to return.context
- the XWiki context.
Collection
of String
containing group name.
XWikiException
- error when browsing groups.public Collection<String> getAllMembersNamesForGroup(String group, int nb, int start, XWikiContext context) throws XWikiException
group
- the name of the group.nb
- the maximum number of result to return.start
- the index of the first found user to return.context
- the XWiki context.
Collection
of String
containing user name.
XWikiException
- error when browsing groups.public Collection<String> getAllMatchedMembersNamesForGroup(String group, String matchField, int nb, int start, Boolean orderAsc, XWikiContext context) throws XWikiException
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.context
- the XWiki context.
Collection
of String
containing member name.
XWikiException
- error when browsing groups.public int countAllGroupsNamesForMember(String member, XWikiContext context) throws XWikiException
member
- the name of the member (user or group).context
- the XWiki context.
XWikiException
- error when getting number of users.public int countAllMembersNamesForGroup(String group, XWikiContext context) throws XWikiException
group
- the name of the group.context
- the XWiki context.
XWikiException
- error when getting number of groups.public Map<String,LevelTree> getLevelTreeMap(String spaceOrPage, List<String> levelsToMatch, XWikiContext context) throws XWikiException
LevelTree
Map
for he provided rights levels.
spaceOrPage
- the space of page where to get XWikiRights. If null get wiki rights.levelsToMatch
- the levels names to check ("view", "edit", etc.).context
- the XWiki context.
Map
containing [levelname : LevelTree
].
XWikiException
- error when browsing rights preferences.public XWikiDocument getParentPreference(XWikiDocument currentPreference, boolean currentGlobal, XWikiContext context) throws XWikiException
currentPreference
- the document for which to find parent preferences document.currentGlobal
- indicate if current preferences document is global.context
- the XWiki context.
XWikiException
- error when browsing rights preferences.public XWikiDocument getParentPreference(String spaceOrPage, XWikiContext context) throws XWikiException
spaceOrPage
- the space of page where to get XWikiRights. If null get wiki rights.context
- the XWiki context.
XWikiException
- error when browsing rights preferences.public LevelTree getTreeLevel(String spaceOrPage, String levelName, XWikiContext context) throws XWikiException
spaceOrPage
- the space of page where to get XWikiRights. If null get wiki rights.levelName
- the level right name ("view", "delete"...).context
- the XWiki context.
LevelTree
.
XWikiException
- error when browsing rights.public void removeUserOrGroupFromLevel(String spaceOrPage, String userOrGroup, boolean user, String levelName, boolean allow, String comment, XWikiContext context) throws XWikiException
spaceOrPage
- the space of page where to get XWikiRights. If null get wiki rights.userOrGroup
- the name of the user or group.user
- indicate if it is a user or group.levelName
- the name of the right level.allow
- indicate if user is removed from allow right or deny right.comment
- the comment to use when saving preferences document.context
- the XWiki context.
XWikiException
- error when browsing rights.public boolean removeUserOrGroupFromRight(BaseObject right, String userOrGroupWiki, String userOrGroupSpace, String userOrGroupName, boolean user, XWikiContext context)
right
- the object containing the right preferences.userOrGroupWiki
- the name of the wiki of the use or group.userOrGroupSpace
- the name of the space of the use or group.userOrGroupName
- the name of the use or group.user
- indicate if it is a user or a group.context
- the XWiki context.
public boolean removeUserOrGroupFromRights(XWikiDocument rightsDocument, String userOrGroupWiki, String userOrGroupSpace, String userOrGroupName, boolean user, boolean global, XWikiContext context)
rightsDocument
- the document containing the rights preferences.userOrGroupWiki
- the name of the wiki of the use or group.userOrGroupSpace
- the name of the space of the use or group.userOrGroupName
- the name of the use or group.user
- indicate if it is a user or a group.global
- indicate if user or group is removed from global or document rights.context
- the XWiki context.
public boolean removeUserOrGroupFromAllRights(XWikiDocument rightsDocument, String userOrGroupWiki, String userOrGroupSpace, String userOrGroupName, boolean user, XWikiContext context)
rightsDocument
- the document containing the rights preferences.userOrGroupWiki
- the name of the wiki of the use or group.userOrGroupSpace
- the name of the space of the use or group.userOrGroupName
- the name of the use or group.user
- indicate if it is a user or a group.context
- the XWiki context.
public void removeUserOrGroupFromAllRights(String userOrGroupWiki, String userOrGroupSpace, String userOrGroupName, boolean user, XWikiContext context) throws XWikiException
userOrGroupWiki
- the name of the wiki of the use or group.userOrGroupSpace
- the name of the space of the use or group.userOrGroupName
- the name of the use or group.user
- indicate if it is a user or a group.context
- the XWiki context.
XWikiException
- error when browsing rights.public void removeDirectRights(String spaceOrPage, List<String> levelNames, String comment, XWikiContext context) throws XWikiException
spaceOrPage
- the space of page where to get XWikiRights. If null get wiki rights.levelNames
- the levels names to check ("view", "edit", etc.).comment
- the comment to use when saving preferences document.context
- the XWiki context.
XWikiException
- error when browsing rights.public boolean groupContainsMember(String groupName, String memberName, Map<String,Collection<String>> groupCacheIn, XWikiContext context) throws XWikiException
groupName
- the group name where to search for member.memberName
- the name of the member to find.groupCacheIn
- a map containing a set a group and its corresponding members already retrieved.context
- the XWiki context.
XWikiException
- error when browsing groups.public Collection<DocumentReference> resolveUsers(DocumentReference userOrGroup, XWikiContext context) throws XWikiException
userOrGroup
- the user or groupcontext
- the XWikiContext the XWiki context
XWikiException
- error when getting documentspublic Collection<DocumentReference> resolveUsers(String userOrGroup, XWikiContext context) throws XWikiException
userOrGroup
- the user or groupcontext
- the XWikiContext the XWiki context
XWikiException
- error when getting documentspublic Collection<DocumentReference> resolveUsers(List<String> referenceList, XWikiContext context) throws XWikiException
referenceList
- the list of users and groupscontext
- the XWikiContext the XWiki context
XWikiException
- error when getting documents
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |