- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.xpn.xwiki.user.api.XWikiRightService.hasProgrammingRights()
方法的一些代码示例,展示了XWikiRightService.hasProgrammingRights()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWikiRightService.hasProgrammingRights()
方法的具体详情如下:
包路径:com.xpn.xwiki.user.api.XWikiRightService
类名称:XWikiRightService
方法名:hasProgrammingRights
[英]Checks if the author of the context document (last editor of the content of the document) has programming rights (used to determine if the protected calls in the script contained in the document should be executed or not).
[中]检查上下文文档的作者(文档内容的最后一个编辑器)是否具有编程权限(用于确定是否应执行文档中包含的脚本中受保护的调用)。
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Check if the current document has programming rights, meaning that it was last saved by a user with the
* programming right globally granted.
*
* @return <tt>true</tt> if the current document has the Programming right or <tt>false</tt> otherwise.
*/
public boolean hasProgrammingRights()
{
com.xpn.xwiki.XWiki xwiki = this.context.getWiki();
return xwiki.getRightService().hasProgrammingRights(this.context);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
@GET
public SearchResults search(@PathParam("wikiName") String wikiName, @PathParam("spaceName") String spaceName,
@QueryParam("q") String keywords, @QueryParam("scope") List<String> searchScopeStrings,
@QueryParam("number") @DefaultValue("-1") Integer number) throws QueryException, XWikiException
{
SearchResults searchResults = objectFactory.createSearchResults();
searchResults.setTemplate(String.format("%s?%s",
UriBuilder.fromUri(uriInfo.getBaseUri()).path(SpaceSearchResource.class).build(wikiName, spaceName)
.toString(), SEARCH_TEMPLATE_INFO));
List<SearchScope> searchScopes = parseSearchScopeStrings(searchScopeStrings);
searchResults.getSearchResults().addAll(
search(searchScopes, keywords, wikiName, spaceName, Utils.getXWiki(componentManager).getRightService()
.hasProgrammingRights(Utils.getXWikiContext(componentManager)), number));
return searchResults;
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
@GET
public SearchResults search(@PathParam("wikiName") String wikiName, @QueryParam("q") String keywords,
@QueryParam("scope") List<String> searchScopeStrings, @QueryParam("number") @DefaultValue("-1") Integer number)
throws QueryException, XWikiException
{
SearchResults searchResults = objectFactory.createSearchResults();
searchResults.setTemplate(String.format("%s?%s",
UriBuilder.fromUri(uriInfo.getBaseUri()).path(WikiSearchResource.class).build(wikiName).toString(),
SEARCH_TEMPLATE_INFO));
Utils.getXWikiContext(componentManager).setDatabase(wikiName);
List<SearchScope> searchScopes = parseSearchScopeStrings(searchScopeStrings);
searchResults.getSearchResults().addAll(
search(searchScopes, keywords, wikiName, null, Utils.getXWiki(componentManager).getRightService()
.hasProgrammingRights(Utils.getXWikiContext(componentManager)), number));
return searchResults;
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* {@inheritDoc}
*
* @see org.xwiki.bridge.DocumentAccessBridge#hasProgrammingRights()
*/
public boolean hasProgrammingRights()
{
XWikiContext xcontext = getContext();
return xcontext.getWiki().getRightService().hasProgrammingRights(xcontext);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public XWikiAuthService getAuthService(XWikiContext context)
{
String authservicepage = getParam("groovy_pagename", context);
if ((authservicepage == null) || authservicepage.trim().equals("")) {
if (log.isErrorEnabled())
log.error("No page specified for auth service implementation");
return null;
}
try {
XWikiDocument doc = context.getWiki().getDocument(authservicepage, context);
if (context.getWiki().getRightService().hasProgrammingRights(doc, context))
return (XWikiAuthService) context.getWiki().parseGroovyFromString(doc.getContent(), context);
else {
if (log.isErrorEnabled())
log.error("Auth service implementation page " + authservicepage
+ " missing programming rights, requires ownership by authorized user.");
return null;
}
} catch (XWikiException e) {
if (log.isErrorEnabled())
log.error("Exception while parsing groovy authentication service code", e);
return null;
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
if (!context.getWiki().getRightService().hasProgrammingRights(contextdoc, context)) {
return content;
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* @return the actual value of the property, as a String, Number or List.
*/
public java.lang.Object getValue()
{
// This is evil, any property which happens to be called 'password' will be masked. TODO fix.
if (element.getName().equals("password")
&& !getXWikiContext().getWiki().getRightService().hasProgrammingRights(
getXWikiContext())) {
return null;
}
return ((BaseProperty) element).getValue();
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-gwt-api
XWikiContext context = getXWikiContext();
XWikiDocument queryDoc = context.getWiki().getDocument(queryPage, context);
if (context.getWiki().getRightService().hasProgrammingRights(queryDoc, context)) {
if (params != null) {
XWikiRequestWrapper srw = new XWikiRequestWrapper(context.getRequest());
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
protected void notifyPage(String page, XWikiNotificationRule rule, XWikiDocument doc, String action, XWikiContext context) {
XWikiActionNotificationInterface notif = null;
try {
XWiki xwiki = context.getWiki();
XWikiDocument pagedoc = xwiki.getDocument(page, context);
if (xwiki.getRightService().hasProgrammingRights(pagedoc, context)) {
notif = (XWikiActionNotificationInterface) xwiki.parseGroovyFromString(pagedoc.getContent(), context);
notif.notify(rule, doc, action, context);
}
} catch (Throwable e) {
Object[] args = { page };
XWikiException e2 = new XWikiException(XWikiException.MODULE_XWIKI_GROOVY, XWikiException.ERROR_XWIKI_GROOVY_EXECUTION_FAILED, "Error parsing groovy notification for page {0}", e, args);
if (log.isErrorEnabled())
log.error(e2.getFullMessage());
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform.plugins/xwiki-plugin-scheduler
context.put("sdoc", jobDocument);
if (context.getWiki().getRightService().hasProgrammingRights(context)) {
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Privileged API to retrieve an object instanciated from groovy code in a String Groovy scripts compilation is
* cached
*
* @param fullname // script containing a Groovy class definition (public class MyClass { ... })
* @return An object instanciating this class
* @throws XWikiException
*/
public java.lang.Object parseGroovyFromPage(String fullname) throws XWikiException
{
XWikiDocument doc = this.xwiki.getDocument(fullname, getXWikiContext());
if (this.xwiki.getRightService().hasProgrammingRights(doc, getXWikiContext())) {
return this.xwiki.parseGroovyFromString(doc.getContent(), getXWikiContext());
}
return "groovy_missingrights";
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Privileged API to retrieve an object instantiated from groovy code in a String, using a classloader including all
* JAR files located in the passed page as attachments. Note that Groovy scripts compilation is cached
*
* @param script the Groovy class definition string (public class MyClass { ... })
* @return An object instantiating this class
* @throws XWikiException
*/
public java.lang.Object parseGroovyFromPage(String script, String jarWikiPage) throws XWikiException
{
XWikiDocument doc = this.xwiki.getDocument(script, getXWikiContext());
if (this.xwiki.getRightService().hasProgrammingRights(doc, getXWikiContext())) {
return this.xwiki.parseGroovyFromString(doc.getContent(), jarWikiPage, getXWikiContext());
}
return "groovy_missingrights";
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-scheduler-api
getXWikiContext().put("sdoc", jobDocument);
if (getXWikiContext().getWiki().getRightService().hasProgrammingRights(getXWikiContext())) {
本文整理了Java中com.xpn.xwiki.user.api.XWikiRightService.hasAdminRights()方法的一些代码示例,展示了XWikiRightService.ha
本文整理了Java中com.xpn.xwiki.user.api.XWikiRightService.hasProgrammingRights()方法的一些代码示例,展示了XWikiRightServ
本文整理了Java中com.xpn.xwiki.user.api.XWikiRightService.hasAccessLevel()方法的一些代码示例,展示了XWikiRightService.ha
我是一名优秀的程序员,十分优秀!