Restricted visability

0
can some please help me with the following: Use case: I am setting up an app where users are able to request supplies and send service requests. All service requests and supply requests are presented in a ‘Data Grid’.  Problem:  - users should be able to see supply requests sent by all users in a Data Grid. - users should only be able to see their own service requests in the same Data Grid - manager can see all supply- and service requests from everyone in a Data Grid.  
asked
4 answers
5

HI Mark,
You can keep 2 separate pages for 1 for Manager and 1 for User. 


For you first two points : 
Add a DataGrid with Datasource as microflow and you write your logic there. I have created once logic for you for Domain Model Similar to yours. 


Here is my Domain Model :
I have enabled System.owner for Request Over view. 



 

Expressions for your Reference in List operation (Filter With Expression) :

To retrieve all Supply Request :
$currentObject/ForumQuestions.Request_Supply!=empty

To retrieve Service Request created by Logged in user:


$currentObject/System.owner=[%CurrentUser%]
and 
$currentObject/ForumQuestions.Request_ServiceRequest!=empty


The Only Fall back with this approach is you will loose default Data grid Search Functionalities. 


I have a suggestion , you can add an Enumeration attributes which hold the type of Requests like, Gift, ServiceRequest, SupplyRequest, FoodBevrage  in your Request_Overview entity.  You can add a drop  down to select the type of request. 

 

 

Then you can add a Datgrid with a Xpath Constraint , with this approach Default Datagrid functionalities will be enabled.
[RequestType='Supply' or System.owner='[%CurrentUser%]']

You can choose either of option to achieve your Functionality. 

And for Manager you can create Similar flow.

Hope this Helps . All the Best!!

answered
0

 

Hi Eline, this our domain model

answered
0

Hi Mark,

Just a short remark: you may want to consider using a TemplateGrid or List view instead of a datagrid. This allows for easy retrieval of each description using data views and visibility.

I hope this helps.

Michiel

answered
0

for visible to current user:$currentObject/System.owner=[%CurrentUser%]

in xpath 

 

for visible to your manager just create a seperate grid which is visible to managers just make it blank

 

 

answered