21
Views
3
Comments
limit the information depend on the user role

Hi everyone,

I have a table page in my web display all the submitted record, I need to limit the information appear depend on the user role.

means, if the users are (Registered)/regular user I want them to see their own record only.

but if the users are (ADMINs) I want them to see all the submitted record. 


how can I achieve this?


Regards, 


2021-12-23 04-28-09
Navneet Sharma

Hello @Raghad Momin,

You can add one attributes like CreatedBy in your Entity. 

then you can fetch records according to CreatedBy column by login users with Conditions.

I hope this will help you.


Thanks & regards

Navneet Sharma




2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Raghad,

First, you don't specify what you mean by "their own record only". Is that a record created by the employee, regardless of what the EmployeeCode is, or is it a record that contains the EmployeeCode of the employee?

If it's the first, the record of course must contain a CreatedBy, as Navneet wrote, so you can filter on that. If it's the latter, you can filter on the EmployeeCode, or perhaps better, an Employee Identifier (working with identifiers is always easier than codes).

As for the actual Filter, you need to limit the records shown only if the user isn't an admin user. So you need to determine whether this is the case, then have a filter like this:

Entity.EmployeeId = UserEmployeeId or UserIsAdmin

Of course, the actual expression depends heavily on the actual names of entities, attributes and variables.

2025-09-25 14-38-22
Lokesh Kumar Yadav

Hi Raghad,

I understand your query i will send to oml file it is similar to your .Check and try on your oml file. Any doubt comes then send me your oml file 

UserRoleWithBlck.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.