<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extending the Permission Service to allow permissions based on aspects in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293052#M246182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to be able to assign permissions based on aspects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use case:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Our Alfresco deployment uses External Authentication for logging in. Our external authentication method allows users to log in by login/password or using a two factor method involving a Common Access Card.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The external authentication system sets an HTTP header variable that identifies which method the user used to log in.&amp;nbsp; An Alfresco extension sets an aspect attribute on the user's person node corresponding to their method of login.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Our Alfresco deployment houses a subset of documents that, by policy, should only be seen/accessed by users who have logged in via the two factor method.&amp;nbsp; These sensitive documents are marked as such using an aspect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Permission to documents needs to be determined based on the whether the user has permission to the document through their site access, the user's authentication method and the document's sensitive.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at some of the Alfresco documentation on the permission service (&lt;/SPAN&gt;&lt;A href="http://docs.alfresco.com/5.0/concepts/implserv-permiss.html" rel="nofollow noopener noreferrer"&gt;http://docs.alfresco.com/5.0/concepts/implserv-permiss.html&lt;/A&gt;&lt;SPAN&gt;), it appears that this is what I need to extend/modify in order to accomplish what I want. Note that the referenced page says that the permission service is responsible for 'Determining if the current, authenticated user has permission to a node'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Outside of defining/modifying permission definitions, there's not a lot of information or examples on how to go about extending the permission service.&amp;nbsp; What classes of the permission service perform the action of determining whether a user has permission to a node. What is the best way to go about extending it to look at whether the user's aspect indicates they have authenticated via two-factor and whether the current document requires it for access.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2015 16:14:05 GMT</pubDate>
    <dc:creator>vamirr</dc:creator>
    <dc:date>2015-07-24T16:14:05Z</dc:date>
    <item>
      <title>Extending the Permission Service to allow permissions based on aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293052#M246182</link>
      <description>I would like to be able to assign permissions based on aspects.Use case&lt;IMG id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;ur Alfresco deployment uses External Authentication for logging in. Our external authentication method allows users to log in by login/password or using a two factor method involving a Common Access Card.The external authentica</description>
      <pubDate>Fri, 24 Jul 2015 16:14:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293052#M246182</guid>
      <dc:creator>vamirr</dc:creator>
      <dc:date>2015-07-24T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the Permission Service to allow permissions based on aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293053#M246183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;typically, you do not extend the PermissionService and even when - it is not a customization recommended by Alfresco. The extension points of custom permissions and dynamic authorities are - from my experience - more than enough to address between 95-99% of use cases. Your requirements sound like something that could be achieved using these two concepts with a bit of "creative coding". Also - instead of extending the permission service you might want to consider simply facading it to add your custom checks AFTER the standard implementation has run and only when appropriate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless, to answer your question: The PermissionServiceImpl is the class you are looking for. It is a self-contained collection of the service and the low level ACL evaluation ("Does user x have permission y?"). In case you do decide to extend it, maybe the best point would be the high-level hasPermission(NodeRef, PermissionReference) method - at lower levels you loose the context necessary to check you aspects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 08:16:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293053#M246183</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2015-07-27T08:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extending the Permission Service to allow permissions based on aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293054#M246184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Axel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your comments, you have been extremely helpful.&amp;nbsp; I was able to achieve my requirement by implementing a MethodInterceptor and wiring that into the NodeService.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 13:30:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/extending-the-permission-service-to-allow-permissions-based-on/m-p/293054#M246184</guid>
      <dc:creator>vamirr</dc:creator>
      <dc:date>2015-07-28T13:30:30Z</dc:date>
    </item>
  </channel>
</rss>

