<?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 How to limit access to an ADW extension to a group? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19183#M8488</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have created 2 extensions for ADW. I would like to restrict these extensions to some functionnal groups.&lt;/P&gt;&lt;P&gt;We have added a rule for this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"features": {
    "navbar": [
      {
        "id": "my.ext.nav",
        "rules": {
          "visible": "app.isAffiche"
        },
        "items": [
          {
            "id": "my.ext.main",
            "icon": "extension",
            "title": "My extension",
            "route": "my.ext.route"
          }
        ]
      }
    ]
  }&lt;/PRE&gt;&lt;P&gt;And an Evaluator :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    import * as rule from './my-ext.service';
    extensions.setEvaluators({
      'app.isAffiche': rule.isAffiche
    });&lt;/PRE&gt;&lt;P&gt;We add rule.isAffiche in the service, it works when we make it send true or false:&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, then I changed to check the user groups:&lt;/P&gt;&lt;PRE&gt;export const isAffiche = (): boolean =&amp;gt;
{
  groupService: GroupService;
  let groupService;
  const groupsEntries: GroupEntry[] = await groupService.listAllGroupMembershipsForPerson('-me-', {maxItems: 250});
  let groupIdList = groupsEntries.map((obj) =&amp;gt; obj.entry.id);
  groupIdList.forEach(group =&amp;gt; {
    if (group.includes("My-authorized-group")) {
      return  true;
    }
    return false;
  });
};&lt;/PRE&gt;&lt;P&gt;But then it doesn’t work anymore. Maybe it is because there is an async call?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Aug 2023 08:44:08 GMT</pubDate>
    <dc:creator>tmeedend_adv</dc:creator>
    <dc:date>2023-08-07T08:44:08Z</dc:date>
    <item>
      <title>How to limit access to an ADW extension to a group?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19183#M8488</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have created 2 extensions for ADW. I would like to restrict these extensions to some functionnal groups.&lt;/P&gt;&lt;P&gt;We have added a rule for this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;"features": {
    "navbar": [
      {
        "id": "my.ext.nav",
        "rules": {
          "visible": "app.isAffiche"
        },
        "items": [
          {
            "id": "my.ext.main",
            "icon": "extension",
            "title": "My extension",
            "route": "my.ext.route"
          }
        ]
      }
    ]
  }&lt;/PRE&gt;&lt;P&gt;And an Evaluator :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    import * as rule from './my-ext.service';
    extensions.setEvaluators({
      'app.isAffiche': rule.isAffiche
    });&lt;/PRE&gt;&lt;P&gt;We add rule.isAffiche in the service, it works when we make it send true or false:&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, then I changed to check the user groups:&lt;/P&gt;&lt;PRE&gt;export const isAffiche = (): boolean =&amp;gt;
{
  groupService: GroupService;
  let groupService;
  const groupsEntries: GroupEntry[] = await groupService.listAllGroupMembershipsForPerson('-me-', {maxItems: 250});
  let groupIdList = groupsEntries.map((obj) =&amp;gt; obj.entry.id);
  groupIdList.forEach(group =&amp;gt; {
    if (group.includes("My-authorized-group")) {
      return  true;
    }
    return false;
  });
};&lt;/PRE&gt;&lt;P&gt;But then it doesn’t work anymore. Maybe it is because there is an async call?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 08:44:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19183#M8488</guid>
      <dc:creator>tmeedend_adv</dc:creator>
      <dc:date>2023-08-07T08:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit access to an ADW extension to a group?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19184#M8489</link>
      <description>&lt;P&gt;Yes, the rule engine is synchronous. At this point all evaluators should be sync too.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2023 13:53:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19184#M8489</guid>
      <dc:creator>denys</dc:creator>
      <dc:date>2023-08-10T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit access to an ADW extension to a group?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19185#M8490</link>
      <description>&lt;P&gt;Ok, so how can we achieve that correctly? Any hint?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 09:26:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19185#M8490</guid>
      <dc:creator>tmeedend_adv</dc:creator>
      <dc:date>2023-08-24T09:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit access to an ADW extension to a group?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19186#M8491</link>
      <description>&lt;P&gt;You should already have groups as part o the user loading process: &lt;A href="https://github.com/Alfresco/alfresco-content-app/blob/6422c32df3a1c34d0cd35624c5658e25f8942acb/projects/aca-shared/src/lib/services/app.service.ts#L185" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-content-app/blob/6422c32df3a1c34d0cd35624c5658e25f8942acb/projects/aca-shared/src/lib/services/app.service.ts#L185&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That means your custom evaluators can check the "context.profile.groups" array&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:10:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-limit-access-to-an-adw-extension-to-a-group/m-p/19186#M8491</guid>
      <dc:creator>denys</dc:creator>
      <dc:date>2023-08-24T14:10:49Z</dc:date>
    </item>
  </channel>
</rss>

