Sneedforo

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
My current issue is the permission system. I have written complex permission systems before (namely for Infinity Next), but without OOP I'm not 100% on what to do for it. There is no Rust solution in a crate.

Forum style permission system is very layered.

There are general permissions (per group or user-specific) and resource permissions.
1652716875999.png


A user has some default permissions set by the primary group Registered User.
1652716998561.png

Each resource (chat rooms, forums, etc) can have specific permissions per group and per individual.
1652717056831.png

i.e. users banned from BP have a specific restriction group. In the Beauty Parlor category, it is set. This affects child boards like Death Fats.
1652717087466.png

1652717118270.png

Users can have category specific permissions set, like mods.
1652717143567.png

1652717171069.png

These permissions also apply per category.

These permissions flatten. A permission is NO unless a some layer adds YES. If any group has NEVER, it is always NO.


I'm writing this out because I want to die.
 
What counts as a "resource" besides chat rooms and forums? (And is there a 1:1 correspondence between chat rooms and forums or what?)

I'm thinking all "permissionables" should just form their own "permission trees" that you can traverse. Unless it really is a 1:1 thing and then you can just add a flag to one or the other.
 
What counts as a "resource" besides chat rooms and forums? (And is there a 1:1 correspondence between chat rooms and forums or what?)

I'm thinking all "permissionables" should just form their own "permission trees" that you can traverse. Unless it really is a 1:1 thing and then you can just add a flag to one or the other.
There is a thing I don't understand yet on src/middleware/append_content.rs

I keep finding "use crate::user : : client" and I can't tell where it inherits rules/state from.
 
  • Informative
Reactions: Dork Of Ages
Don't tell the trannies at async-std you're using it, soon they'll make an exception in their license for you for wrongthink.
 
  • Thunk-Provoking
Reactions: Dork Of Ages
Would it make any sense to write this as a database view that could be queried directly when checking CRUD is valid or joined onto and used to filter when retrieving threads/forums/etc and try it at scale and maybe make it a materialized view if it runs like shit?
I had questions, maybe they are very dumb, but I am curious.

1. What is the operational need to assign permissions in groups as well as individually? Querying users by shared permissions seems reasonable, but a group to assign permissions seems like an extraneous layer (beyond key types, like Mod, Admin, etc.) This is an operations question. It depends how you want to use these things.

2. The actix-session/src/session.rs contains 4 session states that talk to the...Imma call it "database." I think it skips through a different "handling" interface first. The function that assigns individual user permissions is (I think) src/middleware/append_context.rs ...but I can't see how it works. There are almost always conflicts in permission hierarchies, especially when there are "groups" that allow the assignment of redundant actions as "user". There are many ways to fix this, but it can be hard to see what is causing the problem.
 
Null, you got any screenshots of it? I'm too lazy to set up your slobberforo. (Like homepage screenshots so I know when to panic)
I'll set one up on a Linode VPS or something temporarily. Give me a sec.
 
  • Winner
Reactions: thebigjoel
Back