Delete user role

So I have a database that has different modules, property, admin, user etc

The admin is required to add a user to a role and also remove them against each module.

As an example for property access. All users, are as per normal held in the Accounts table and then the permissions are held in ‘property permission’ table.

On the module screen a list of users are listed from the Accounts table there is a (a) column where user role contains ‘property permission’ and another (b) column where the user roles does not contain ‘property permission’.

Column (a) action is to remove the permission as they already have it
Column (b) action is to add the permission as they do not have it

Column (b) works find - adding a new row for the relevant user into the ‘property permission’

Column (a) does not delete the relevant row from the ‘property permission’

Sorry for the long text and hope someone can help!

1 Like

Not sure I totally understand your example. However, I think it’s to do with the fact that you can’t remove a role from a user if you are in that role. You can only remove a role from a user via the accounts object.

Sorry it may not have made sense I have moved further on with it and have posted another question re password issue.