Computer Science, asked by omagrawal7451, 1 year ago

Which methods help the roleprovider determine whether a user is assigned a role or set of roles ?

Answers

Answered by shree543
0

Multiple roles can be done as such: [CustomAuthorize(Roles = "Administrator, User")] But seeing you've written this code I'd think you'd know this already?

If all you want to do is keeps Users from getting in your create/edit/delete functions, why not use the default authorisation functions? meaning, put [CustomAuthorize(Roles = "Administrator")] above edit/create/delete and [CustomAuthorize(Roles = "Administrator, User")] above anything else...

I'm guessing the IsUserInRole gets called on authorisation? This method should take a string[] roleName array, and not just a string.

Similar questions