【问题标题】:Alfresco SetInherite permission webscript security apiAlfresco SetInherite 权限 webscript security api
【发布时间】:2015-01-18 15:30:05
【问题描述】:

我尝试为 alfresco 创建脚本以设置继承权限,但我不知道我的脚本是否正确这是我的脚本:

继承.post.xml

<webscript>
<shortname>Inherit Permission</shortname>
<description>Inherit Permission of a User or  Group from a Folder or Space</description>
<url>/set/folder/permission/inherit/?folderName={folderName}</url>
<format default="html"/>
<transaction>required</transaction>
<authentication>user</authentication>

继承.post.html

<html>
<body>
<p>${myStatus}</p>
</body>
</html>

InheritePermission.post.js

//search for the folder node using lucene search
var folderNode =  search.luceneSearch("TYPE:\"{http://www.alfresco.org/model/content/1.0}folder\" AND @cm\\:name:"+args.folderName);

//make sure we only get one node

if(folderNode.length == 1){

folderNode[0].setInheritsPermissions(false);

model.myStatus = "Héritage permis";
}else  if (folderNode.length == 0){
//no node was found
model.myStatus = "Folder not found";
}else{
//either greater than two  was found
model.myStatus = "Duplicate folder found";
}

【问题讨论】:

    标签: javascript lucene alfresco


    【解决方案1】:

    网页脚本的文件名应如下所示。

    • helloworld.get.desc.xml(你的名字打错了应该是Inherit.post.desc.xml
    • helloworld.get.js
    • helloworld.get.html.ftl
    • helloworld.get.xml.ftl
    • helloworld.get.html.400.ftl
    • helloworld.get.xml.400.ftl
    • helloworld.get.config.xml
    • helloworld.get.properties

    【讨论】:

      【解决方案2】:

      在 alfresco 中使用 webscript 的命名约定如下

      <webscriptname>.<HTTPMethod>.desc.xml (For description file)
      <webscriptname>.<HTTPMethod>.js (For javascript controller file of webscript)
      <webscriptname>.<HTTPMethod>.<outputformat>.ftl (For response/template file)
      <webscriptname>.<HTTPMethod>.properties (Property file)
      

      HTTPMethod:值可以是 get、post、put、delete,具体取决于所需的 webscript 类型,但它必须对所有文件保持一致(显然 :))。

      OutputFormat:输出格式表示您期望的输出类型,根据您的要求,值可以是 json、xml、html。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多