Expand my Community achievements bar.

We are excited to introduce our latest innovation to enhance the Adobe Campaign user experience — the Adobe Campaign v8 Web User Interface!
SOLVED

How to filter displayed schema in query

Avatar

Level 2

Hello,

I would to limit the available schema taht user can select in query.

I know I'm not suppose to extend xtkSchema but I know that it's here that it can be done, so I had the following sysfilter

<sysFilter name="test">

      <condition enabledIf="hasNamedRight('admin')=false" expr="@namespace = 'cus'"/>

</sysFilter>

but the hasNamesRight function didn't seem to work, did someone know why ?

I use an Adobe Campaign v7 build 8853

Thanks for your help,

Mathieu

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Mathieu,

You have made a mistake, use this to limit this access to Admin users only, non-admin will not be able to access this schema.

<sysFilter name="readAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

    </sysFilter>

     <sysFilter name="writeAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

</sysFilter>

Or Use following with a valid id to provide access to only one account, there is no login id like admin:

<sysFilter name="readAccess">

      <condition enabledIf="$(login)!=1053" expr="FALSE"/>

    </sysFilter>

     <sysFilter name="writeAccess">

      <condition enabledIf="$(login)!=1053" expr="FALSE"/>

</sysFilter>

After that, you need to regenerate the schemes and delete cache.

Hope this helps!

Amit

View solution in original post

6 Replies

Avatar

Employee

Hi Mathieu,

Although I don't know if this is possible in xtk :schema but you can try using the expression as enabledIf="hasNamedRight('admin')=true" . Also try to change the filtering attribute to accessibleIf or visibleIf to see if it works.

For more info on how to restrict display , follow this guide

Regards,

Adhiyan

Avatar

Level 2

Hi Adhiyan,

Thanks for your answer, but I don't want to hide fields of a schema I wnat to hide schema itself.

I want that users don't have access to all the standard schemas but only the ones I create for them in the following screen, which correspond to xtkSchema :

1276130_pastedImage_1.png

Do you think it is possible ?

Regards,

Mathieu

Avatar

Level 10

Hi Mathieu,

Maybe what's described here would better serve your purpose: Protecting schemas

Let me know,

Florent

Avatar

Level 2

Hi Florent,

I just try it and put this code in a schema :

<sysFilter name="readAccess">

      <condition enabledIf="$(login)!='admin'" expr="FALSE"/>

    </sysFilter>

     <sysFilter name="writeAccess">

      <condition enabledIf="$(login)!='admin'" expr="FALSE"/>

</sysFilter>

If I understand with this sysfilter only the admin user will hava access to this schema, but if I connect with another account it is still avalaible in a query activity.

Did I do it wrong ?

Regards,

Mathieu

Avatar

Correct answer by
Level 10

Hi Mathieu,

You have made a mistake, use this to limit this access to Admin users only, non-admin will not be able to access this schema.

<sysFilter name="readAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

    </sysFilter>

     <sysFilter name="writeAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

</sysFilter>

Or Use following with a valid id to provide access to only one account, there is no login id like admin:

<sysFilter name="readAccess">

      <condition enabledIf="$(login)!=1053" expr="FALSE"/>

    </sysFilter>

     <sysFilter name="writeAccess">

      <condition enabledIf="$(login)!=1053" expr="FALSE"/>

</sysFilter>

After that, you need to regenerate the schemes and delete cache.

Hope this helps!

Amit

Avatar

Level 2

Hi Amit,

Thanks for your answer, I try the solution with the HasNamedRight condition and user without its named right can still make request on my scheme.

I do have regenerate it and delete my cache but it doesn't seem to work, here the xml of my scheme, as I only do some test it's really simple  :

<srcSchema _cs="test (cus)" created="2017-08-18 21:49:28.000Z" createdBy-id="0" entitySchema="xtk:srcSchema"

           img="xtk:schema.png" label="test" lastModified="2017-08-28 09:24:47.000Z"

           mappingType="sql" md5="3F13A38D37ECB68ED77A28E18B84E7B2" modifiedBy-id="0"

           name="test" namespace="cus" xtkschema="xtk:srcSchema">

  <createdBy _cs="Administrateur (admin)"/>

  <modifiedBy _cs="Administrateur (admin)"/>

  <element label="test" name="test">

    <attribute label="test" name="test" type="long"/>

    <sysFilter name="readAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

    </sysFilter>

    <sysFilter name="writeAccess">

      <condition enabledIf="hasNamedRight('admin')=false" expr="FALSE"/>

    </sysFilter>

  </element>

</srcSchema>

I will explain with more details what I trying to do :

Users with named right grp1 can request on schemes A,B,C

Users with named right grp2 can request on schemes D and E

Users with named right grp3 can request on scheme F

Thanks for your help,

Regards,

Mathieu