They should inferred automatically from your Attribute usage, are any custom roles appearing? Can you repro this issue in a new project? e.g. a fork of https://github.com/NetCoreApps/BookingsCrud that includes a protected Service with Roles that don’t appear?
It’s better for ServiceStack to automatically aggregate the roles, but you can also ensure Roles are added by registering an AppMetadata Filter after the plugins ar run to the AdminUsers metadata, e.g:
I don’t understand what the issue is, the custom role is appearing in the UI:
I’m able to create a new user with the role, remove it, save it, re-add it, save it, etc. Everything’s working as expected. What is the issue and what are the exact steps to repro it?
Also you don’t need to use [RequiresAnyRole] with Admin role as it’s a super user role that can already access all protected services and when you use any of the [Require*] Auth Attributes it also implicitly requires Authentication so you can just use a single [RequiredRole] attribute instead, e.g:
The issue for me is I don’t see the roles in the drop down. If I click on it nothing happens. Clicking on it makes it look like the screenshots in my previous post. I dont see the 2 roles that you have screenshot in the dropdown inside ss studio.
Strange that we’re seeing different behavior in the same App. Can you update the app tool if you haven’t already so you’re also running the latest version of Chromium:
$ dotnet tool update -g app
If it’s still an issue can you launch Studio in debug mode:
This should return the roles in the App i.e. an observable array of ["Admin", "SubSite"]. If it does then I’m assuming you have a JS error preventing the drop down from working, can you go through the console history and paste any JS Exceptions that might cause the issue.
If I run it in debug mode then it works fine and drop down populates with no errors. if I load it with app open studio command then the drop down does not populate.