Forum Discussion

alexlmiddleton's avatar
alexlmiddleton
Frequent Visitor
7 years ago
Solved

Creating roles based on distinct values

Good morning!

I posted here yesterday, but realized overnight there's probably a far easier way to do what I'm trying to do.

 

Our data looks something like:

DepartmentEmployeeJob Class
0057 John Smith100
0058Frank Doe

101

0058John Jamieson107
0059Jane Friend115
0060Samuel Beckett100
0060James Joyce103
0061Alex Middleton103

We have (literally) hundreds of departments, and all of those departments need row level filtering to view their own data.  In programming (Python) terms, we need to take our list of department codes, turn it into a set (remove the duplicates), and then create a list of roles based on that set.  So, 0057, 0058, 0058, 0059, 0060, 0060, and 0061 turns into 0057, 0058, 0059, 0060, and 0061.

 

How can I mass create roles based on the unique values in a column?

 

Thanks!

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi alexlmiddleton ,

    Normally dynamic RLS are based on username function.

    For your requirement, you can apply RLS filter on value fields which you mentioned(use 'username' look up correspond value field and use this value to filter records).
    After these steps, it will enable RLS filter effect based on username's department field.

    Regards,

    Xiaoxin Sheng

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi alexlmiddleton ,

    Normally dynamic RLS are based on username function.

    For your requirement, you can apply RLS filter on value fields which you mentioned(use 'username' look up correspond value field and use this value to filter records).
    After these steps, it will enable RLS filter effect based on username's department field.

    Regards,

    Xiaoxin Sheng