public class XWikiUser extends Object
Constructor and Description |
---|
XWikiUser(DocumentReference userReference)
Create a XWikiUser from its document reference and infer if the user is global or not based on the wiki part of
this reference.
|
XWikiUser(DocumentReference userReference,
boolean main)
Create a XWikiUser from its document reference and set the main flag.
|
XWikiUser(String user)
Deprecated.
since 11.6RC1 use
XWikiUser(DocumentReference) . |
XWikiUser(String user,
boolean main)
Deprecated.
since 11.6RC1 use
XWikiUser(DocumentReference, boolean) . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
exists(XWikiContext context) |
String |
getFullName() |
String |
getUser()
Deprecated.
since 11.6RC1 use
getFullName() . |
DocumentReference |
getUserReference() |
boolean |
isActive(XWikiContext context) |
boolean |
isDisabled(XWikiContext context) |
boolean |
isMain()
See if the user is global (i.e.
|
boolean |
isUserInGroup(String groupName,
XWikiContext context)
Check if the user belongs to a group or not.
|
void |
setActiveStatus(boolean active,
XWikiContext context) |
void |
setDisabled(boolean disabled,
XWikiContext context) |
void |
setMain(boolean main) |
void |
setUser(String user) |
String |
toString() |
public XWikiUser(DocumentReference userReference)
isMain()
for more information.userReference
- the document reference of the user.public XWikiUser(DocumentReference userReference, boolean main)
isMain()
).userReference
- the document reference of the user.main
- true if the user is global (i.e. registered in the main wiki)@Deprecated public XWikiUser(String user)
XWikiUser(DocumentReference)
.user
- the full name of the user on the form XWiki.Foo.@Deprecated public XWikiUser(String user, boolean main)
XWikiUser(DocumentReference, boolean)
.user
- the full name of the user on the form XWiki.Foo.main
- true if the user is global (i.e. registered in the main wiki)@Deprecated public String getUser()
getFullName()
.public String getFullName()
public DocumentReference getUserReference()
public boolean isDisabled(XWikiContext context)
context
- used to retrieve the user document.public void setDisabled(boolean disabled, XWikiContext context)
disabled
- true if the user is disabled (i.e. it can't login or make actions). False to enable the account.context
- used to retrieve the user document.public boolean isActive(XWikiContext context)
context
- used to retrieve the user document.public void setActiveStatus(boolean active, XWikiContext context)
active
- true if the user activated the account. False to deactivate the account.context
- used to retrieve the user document.public boolean exists(XWikiContext context)
context
- used to retrieve the user document.public void setUser(String user)
public boolean isUserInGroup(String groupName, XWikiContext context) throws XWikiException
groupName
- The group to check.context
- The current context
.XWikiException
- If an error occurs when checking the groups.public boolean isMain()
public void setMain(boolean main)
Copyright © 2004–2019 XWiki. All rights reserved.