Authorization roles and permissions

I use ServiceStack and started adding role based authorization to my service. From the documentation, I see that there are services for assigning and removing roles from a user through a web service.

My question is, are there any built-in services included in ServiceStack to request the roles and permissions that the user currently has?

+6
source share
1 answer

ServiceStack does not have a built-in service that returns roles and user permissions, but it's easy enough to create your own service for this, for example, you can read it from a session using something like:

 public class MyService : Service { public object Get(UserRoles request) { var session = this.GetSession(); return new UserRolesResponse { Roles = session.Roles, Permissions = session.Permissions, }; } } 

Example admin service to return all users. For Auth information, see SocialAppage SocialBoostrap .

+7
source

All Articles