Reputation: 167
We have four claims:
CanViewPosts, CanEditPosts, CanAddPosts, CanDeletePosts
Now, I want to create a role Moderator
and assign two claims CanViewPosts, CanEditPosts
to this role.
Then, I create a user with mail [email protected]
and assign the Moderator
role to this user.
I can assign roles to a user, but I want to dynamically assign claims to a role. Because, I will give multiple users, a same role.
How can I implement this in .NET Core 5 ?
Upvotes: 2
Views: 75
Reputation: 91
yes you can assign claims and roles in identity server, if you are using identity server use claim type of role and claim value is CanViewPosts, CanEditPosts
Upvotes: 1