I need to check in conditional logic if a user has more that one role associated.
Script should work like:
If a user has 1 role CODE OK
If a user has more that 1 role CODE ERROR
The method is
GetRolesForUser();
But I do not know how to use it, could you please give me a sample of code? how to implement it, arrays?
Thanks guys
Are you saying that you are using the built in GetRolesForUser() method? If so, that returns a string array so you can just look at the response by checking if the array has more than one:
If you are saying you need to implement your own, then you can follow the basic code show in the link above.