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,
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
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.
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