如何使用spring security taglib编写以下条件?
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<sec:authorize access="not of hasRole('ROLE_ADMIN')">
<div> show these for only non admins </div>
</sec:authorize>
Run Code Online (Sandbox Code Playgroud) 我有一个具有如下属性的组件.
@Component(immediate = true, metatype = true, label = "Conf Details")
@Service(value = { LocationConfigurationUtil.class })
@Properties({
@Property(label = "location blueprint", name = "locationPath", value = "", description = "..."),
@Property(label = "location page template", name = "locationTemplate", value = "", description = "..."),
@Property(label = "basepath live copies", name = "liveCopyRoot", value = "/content/WebRoot", description = "...") })
public class LocationConfigurationUtil {
@Activate
protected void activate(Map<String, Object> mapCreated) {
// some code
}
}
Run Code Online (Sandbox Code Playgroud)
为了使它成为jcr节点中的可编辑属性,我使用了非标准方法.我sling:OsgiConfig在路径/apps/system/config中创建了具有在java代码中声明的属性,它工作正常. …
我有一个工作流程.
在第一步中,它设置了一个名为language的变量.
WorkflowData data = workItem.getWorkflow().getWorkflowData();
data.getMetaDataMap().put("language", "English");
workflowSession.updateWorkflowData(workItem.getWorkflow(), data);
Run Code Online (Sandbox Code Playgroud)
接下来是"OR SPLIT",它有2个带有ECMA脚本的分支.第一个分支是默认选中并具有以下内容
function check(){
var action = workflowData.getMetaDataMap().get("language");
return (action == "en_US");
}
Run Code Online (Sandbox Code Playgroud)
第二个分支只有,
function check(){
return true;
}
Run Code Online (Sandbox Code Playgroud)
当流程通过第一个分支时,它工作正常.如果它通过第二个分支我面临以下错误.
com.adobe.granite.workflow.WorkflowException: No route found to continue from step node1 in model /etc/workflow/models/example/jcr:content/model. Probably a configuration error.
at com.adobe.granite.workflow.core.WorkflowSessionImpl.getRoutes(WorkflowSessionImpl.java:734)
at com.adobe.granite.workflow.core.job.HandlerBase.complete(HandlerBase.java:497)
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:336)
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:512)
at org.apache.sling.event.impl.jobs.queues.JobRunner.run(JobRunner.java:205)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
我必须得到行政支持org.apache.sling.api.resource.ResourceResolver.
但API ResourceResolverFactory.getAdministrativeResourceResolver(Map<String,Object> authenticationInfo)被贬低了.