FritzAndFriends / SharpSite

A basic CMS built with .NET 9 and Blazor
MIT License
37 stars 19 forks source link

Grant roles / permissions to users #66

Open csharpfritz opened 2 weeks ago

csharpfritz commented 2 weeks ago

We should define some initial roles for SharpSite and allow administrators to assign those to users:

A system admin can do anything on the application

An editor cannot change application configuration, but can read / write any and all content

A writer can only read / write posts

yudjinn commented 2 weeks ago

A common approach to this can be done by making a Role a collection of CRUD operations. For example:

Then gates for getOtherUser(id) can check that the asking session's user has "R" perm for other users (likely through middleware or something)