“无下载”自定义角色

时间:2015-02-23 01:47:56

标签: alfresco alfresco-share

我们正在使用Alfresco Community 4.2.c,并且需要限制某些用户下载文档。

根据我们在此论坛和其他来源中学到的内容,我们可以删除/隐藏特定角色的下载按钮和文档操作。我们已成功隐藏下载按钮和文档操作,并仅向具有CanDownload权限的特定用户显示它们。我们创建了新角色" Viewer"没有下载访问权限,并为默认权限Collaborator,Contributor,Editor和Consumer添加了CanDownload权限。前三个按预期工作,但最后一个,消费者,没有。在消费者中,下载按钮仍然是隐藏的,尽管它具有CanDownload权限。

这是我们添加到permissionDefinitions.xml

的内容
<permissions>
   <permissionSet type="sys:base" expose="all" >      
      <permissionGroup name="DownloadPermission" allowFullControl="false" expose="true" />
      <permission name="_DownloadPermission" expose="false" >
         <grantedToGroup permissionGroup="DownloadPermission" />
      </permission>
   </permissionSet>

   <permissionSet type="cm:cmobject" expose="selected">
      <permissionGroup name="Administrator" allowFullControl="true" expose="false" />

      <permissionGroup name="Coordinator" allowFullControl="true" expose="true" />

      <permissionGroup name="Collaborator" allowFullControl="false" expose="true">
         <includePermissionGroup permissionGroup="Editor" type="cm:cmobject" />
         <includePermissionGroup permissionGroup="Contributor" type="cm:cmobject" />
         <!-- Added 18/2/2015 -->
         <includePermissionGroup permissionGroup="CanDownload" type="cm:cmobject" />
      </permissionGroup>

      <permissionGroup name="Contributor" allowFullControl="false" expose="true" >
         <includePermissionGroup permissionGroup="Consumer" type="cm:cmobject"/>
         <includePermissionGroup permissionGroup="AddChildren" type="sys:base"/>
         <includePermissionGroup permissionGroup="ReadPermissions" type="sys:base" />
         <!-- Added 18/2/2015 -->
         <includePermissionGroup permissionGroup="CanDownload" type="cm:cmobject" />
      </permissionGroup>

      <permissionGroup name="Editor"expose="true" allowFullControl="false" >
         <includePermissionGroup type="cm:cmobject" permissionGroup="Consumer"/>
         <includePermissionGroup type="sys:base" permissionGroup="Write"/>
         <includePermissionGroup type="cm:lockable" permissionGroup="CheckOut"/>
         <includePermissionGroup type="sys:base" permissionGroup="ReadPermissions"/>
         <!-- Added 18/2/2015 -->
         <includePermissionGroup permissionGroup="CanDownload" type="cm:cmobject" />
      </permissionGroup>

      <permissionGroup name="Consumer" allowFullControl="false" expose="true" >
         <includePermissionGroup permissionGroup="Read" type="sys:base" />
         <!-- Added 18/2/2015 -->
         <includePermissionGroup permissionGroup="CanDownload" type="cm:cmobject" />
      </permissionGroup>

      <!-- Added 18/2/2015 -->
      <!-- Viewer cannot download documents -->
      <permissionGroup name="Viewer" allowFullControl="false" expose="true" >
         <includePermissionGroup permissionGroup="Read" type="sys:base" />
      </permissionGroup>

      <!-- Added 18/2/2015 -->
      <permissionGroup name="CanDownload" allowFullControl="false" expose="false" >
         <includePermissionGroup permissionGroup="DownloadPermission" type="sys:base" />
      </permissionGroup>
   </permissionSet>

   <permissionSet type="cm:content" expose="selected">
      <permissionGroup name="CanDownload" extends="true" expose="false"/>
      <permissionGroup name="Viewer" extends="true" expose="true"/>
   </permissionSet>

   <permissionSet type="cm:folder" expose="selected">
      <permissionGroup name="CanDownload" extends="true" expose="false"/>
      <permissionGroup name="Viewer" extends="true" expose="true"/>
   </permissionSet>
</permissions>

任何提示或建议都会非常感激。

谢谢。

1 个答案:

答案 0 :(得分:2)

不幸的是,Alfresco /用户界面Share不支持此功能。 Alfresco Share希望对cm:content(document)具有读取权限,包括始终下载。此外,嵌入式闪存查看器仅在用户可以读取和下载文档时才有效。

由于这是一个常见的要求,我们创建了一个Alfresco模块(ecm4u View Only),它只允许(预)使用flash在浏览器中查看特殊文档,并拒绝对内容进行任何访问。特殊文档意味着我们使用方面将其他行为附加到这些文档。这需要在许多地方扩展Alfresco以实现这一目标。我们在所有可用的协议和应用程序中支持此概念。当然,为特殊角色隐藏下载操作会更容易,例如&#34;预览&#34;但如果你有专业知识,这仍然可以下载文件。