Possible to restrict swagger / metadata visibility based on role?

Is it possible use the Restrict(VisibilityTo = and give it a RequiresAnyRole type decoration? I don’t want to broadly limit swagger or metadata, but for example I want only auth visible to non-auth, then “user” based calls to a user role then “admin” type calls to another.

No visibility is controlled with [Exclude(Feature.Metadata)] or [Restrict] attributes.

Just to clarify, there’s no parameter Restrict can take to filter a role? Just the RequestAttributes? (which do not have role type properties?)

No, Restrict attributes don’t have roles.

On second thought, it makes a lot more sense for me to have a couple of instances of the App anyway. Admin, Sandbox, and Prod. Thanks!

1 Like