Validate role transition Checks if a role change is allowed based on business rules
Current user role
Proposed new role
Role of user making the change
true if role transition is valid
canChangeRole('customer', 'admin', 'superadmin') // truecanChangeRole('admin', 'superadmin', 'admin') // false Copy
canChangeRole('customer', 'admin', 'superadmin') // truecanChangeRole('admin', 'superadmin', 'admin') // false
Validate role transition Checks if a role change is allowed based on business rules