Hello Nelson,
Limiting access to roles by ones assigned to current user is not a typical task for Jmix Security. Usually users that have access to administration screens and can create roles are not needed to be restricted. Maybe it make sense to not allow such users to edit roles if they should not see other roles except assigned to them?
If you want to make user edit and see only specific roles, I can suggest several options:
- Create
RowLevelRole
for ResourceRoleEntity
to filter out inappropriate roles. This approach will work if only resource roles access need to be controlled.
- Extend
RowLevelRoleModelDetailView
, RowLevelRoleModelListView
and other views from io.jmi.securityflowui.view.resourcepoilcy
,io.jmi.securityflowui.view.resourcerole
, io.jmi.securityflowui.view.roleassignment
,io.jmi.securityflowui.view.rowlevelpolicy
, io.jmi.securityflowui.view.rowlevelrole
packages where you want to restrict access to not assigned roles.
Could you, please, describe your case on some example, if I misunderstood you and the problem is in something else?
Also I’ve checked that roles created by user with one tenant is not seen by user with another tenant. If it is not so in your case, could you, please, provide a simple reproducible example to see this bug?
Regards,
Dmitry