我的要求是,我不想让任何用户在文档库的所有子文件夹中创建或上传任何文件夹或文档。 为此,我需要使create children权限为false。 因此,请告诉我如何为所有用户的露天文档库中的所有子文件夹创建子项权限false。
请提供示例代码段和执行此操作的步骤。
提前致谢
答案 0 :(得分:1)
我认为您可以创建自己的PermisionGroup。
在您的项目中添加您的xml文件定义:
main\amp\config\alfresco\module\mymodule\bootstrap\custom-sitePermissionDefinitions.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE permissions >
<!-- Custom permissions-->
<permissions>
<!-- Namespaces used in type references -->
<namespaces>
<namespace uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
<namespace uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<namespace uri="http://www.alfresco.org/model/site/1.0" prefix="st"/>
</namespaces>
<permissionSet type="st:site" expose="selected">
<!-- Keep the existing -->
<permissionGroup name="SiteManager" allowFullControl="true" expose="true" />
<permissionGroup name="SiteCollaborator" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Collaborator" type="cm:cmobject" />
</permissionGroup>
<permissionGroup name="SiteContributor" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" />
</permissionGroup>
<permissionGroup name="SiteConsumer" allowFullControl="false" expose="true">
<includePermissionGroup permissionGroup="Consumer" type="cm:cmobject" />
<includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
</permissionGroup>
<!-- Custom role based on the contributor one -->
<permissionGroup name="MyCustomRole" allowFullControl="false" expose="true" >
<includePermissionGroup permissionGroup="Consumer" type="cm:cmobject"/>
<!-- remove the permission to add a children
<includePermissionGroup permissionGroup="AddChildren" type="sys:base"/>
-->
<includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
</permissionGroup>
不要忘记在上下文文件中声明它( module-context.xml ):
<!-- Registration of myproject ROLES -->
<bean id="myproject_permissionBootstrapSite" parent="permissionModelBootstrap">
<property name="model" value="alfresco/module/${project.artifactId}/bootstrap/custom-sitePermissionDefinitions.xml"/>
</bean>