|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xpn.xwiki.api.Api
public class Api
Base class for all API Objects. API Objects are the Java Objects that can be manipulated from Velocity or Groovy in XWiki documents.
Field Summary | |
---|---|
protected XWikiContext |
context
The current context, needed by the underlying protected object. |
Constructor Summary | |
---|---|
Api(XWikiContext context)
|
Method Summary | |
---|---|
protected List<Document> |
convert(List<XWikiDocument> xdocList)
Convert a list of internal representation of documents to public api documents. |
protected Document |
convert(XWikiDocument xdoc)
Convert an internal representation of document to public api document. |
protected XWikiContext |
getXWikiContext()
Get the current context. |
boolean |
hasAccessLevel(String right,
String docname)
Check if the current user has an access level on a given document. |
boolean |
hasAdminRights()
Check if the current user has administration rights either on the current wiki or on the current space. |
boolean |
hasProgrammingRights()
Check if the current document has programming rights, meaning that it was last saved by a user with the programming right globally granted. |
boolean |
hasWikiAdminRights()
Check if the current user has administration rights on the current wiki, regardless of any space admin rights that might also be available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected XWikiContext context
getXWikiContext()
Constructor Detail |
---|
public Api(XWikiContext context)
context
- the XWiki Context objectgetXWikiContext()
Method Detail |
---|
protected XWikiContext getXWikiContext()
public boolean hasProgrammingRights()
public boolean hasAdminRights()
true
if the current user has the admin
right or false
otherwise.public boolean hasWikiAdminRights()
true
if the current user has the admin
right or false
otherwise.public boolean hasAccessLevel(String right, String docname) throws XWikiException
right
- The name of the right to verify (eg "programming", "admin", "register", etc).docname
- The document for which to verify the right.
XWikiException
- In case of an error finding the document or accessing groups information.protected List<Document> convert(List<XWikiDocument> xdocList)
xdocList
- the internal documents.
protected Document convert(XWikiDocument xdoc)
xdoc
- the internal document.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |