01-17-2020, 08:08 PM
I have a tenant table (company) where there may be a number of logins that belong to the company. To accommodate this I added a relationship "tenant_code" column to the sthpw/login table. I am trying to add access rules to make sure a login can only see data related to their parent "tenant". My access rules below don't seem to be doing the trick at the moment.
<rules>
<rule group="builtin" default="deny"/>
<rule group="builtin" key="view_side_bar" access="allow"/>
<rule group="project" code="linborough_dev" access="allow"/>
<rule column="code" value="@GET(login.tenant_code)" search_type="lpc/tenant" op="=" group="search_filter" project="linborough_dev"/>
<rule column="tenant_code" value="@GET(login.tenant_code)" search_type="lpc/lease" op="=" group="search_filter" project="linborough_dev"/>
</rules>
I also tried:
<rules>
<rule group="builtin" default="deny"/>
<rule group="builtin" key="view_side_bar" access="allow"/>
<rule group="project" code="linborough_dev" access="allow"/>
<rule column="code" value="@GET(sthpw/login['login', $LOGIN].tenant_code)" search_type="lpc/tenant" op="=" group="search_filter" project="linborough_dev"/>
<rule column="tenant_code" value="@GET(sthpw/login['login', $LOGIN].tenant_code)" search_type="lpc/lease" op="=" group="search_filter" project="linborough_dev"/>
</rules>
To make sure I have the schema connection working I ran the following expressions in the script editor:
@GET(lpc/tenant['name', 'TEST TENANT'].sthpw/login.login)
@GET(sthpw/login['login', $LOGIN].tenant_code)
I also did try hardcoding a tenant code into the rule to see if it would work but no luck. Just wanted to check if I am missing something simple or its a bug?
thanks!
-Dan
<rules>
<rule group="builtin" default="deny"/>
<rule group="builtin" key="view_side_bar" access="allow"/>
<rule group="project" code="linborough_dev" access="allow"/>
<rule column="code" value="@GET(login.tenant_code)" search_type="lpc/tenant" op="=" group="search_filter" project="linborough_dev"/>
<rule column="tenant_code" value="@GET(login.tenant_code)" search_type="lpc/lease" op="=" group="search_filter" project="linborough_dev"/>
</rules>
I also tried:
<rules>
<rule group="builtin" default="deny"/>
<rule group="builtin" key="view_side_bar" access="allow"/>
<rule group="project" code="linborough_dev" access="allow"/>
<rule column="code" value="@GET(sthpw/login['login', $LOGIN].tenant_code)" search_type="lpc/tenant" op="=" group="search_filter" project="linborough_dev"/>
<rule column="tenant_code" value="@GET(sthpw/login['login', $LOGIN].tenant_code)" search_type="lpc/lease" op="=" group="search_filter" project="linborough_dev"/>
</rules>
To make sure I have the schema connection working I ran the following expressions in the script editor:
@GET(lpc/tenant['name', 'TEST TENANT'].sthpw/login.login)
@GET(sthpw/login['login', $LOGIN].tenant_code)
I also did try hardcoding a tenant code into the rule to see if it would work but no luck. Just wanted to check if I am missing something simple or its a bug?
thanks!
-Dan