freedit-org / freedit

The safest and lightest forum, powered by rust.
https://freedit.eu
MIT License
215 stars 21 forks source link

[bug] roles - Roles are not easily manageable #190

Closed funcyChaos closed 1 month ago

funcyChaos commented 9 months ago

I can see different roles as an enum as well as here and there in the code base, for authentication and controllers I don't see a way to assign a role to a user or what the default role for new users would be I also don't see a way to adjust the ability of roles, like to disallow them from making new Inns

I am still a bit new to MVC and I am new to Rust, but I am familiar with C and C++ which feels at least similar. I will look into solving this for myself, but would appreciate either advise or any other direction

Cheers, Funcy

freedit-dev commented 9 months ago

https://github.com/freedit-org/freedit/issues/98

Yeah, almost everything is hard-coded. I did have a plan to refactor this part, but I need more info to architect it properly.

funcyChaos commented 9 months ago

Let me know if I can help? I definitely think it could be built pretty similarly to wordpress ( :eyes: )

freedit-dev commented 9 months ago

Thanks for your feedback. The role-based access control is a feature that I'm working on. And there is a crate called oso that might be helpful. The problem is that freedit is lack of users, so I don't know which access should be controlled.

https://freedit-org.github.io/freedit/freedit/controller/struct.User.html#permissions

https://freedit-org.github.io/freedit/freedit/controller/inn/index.html#permissions