architecture - What are some architectural best practices to consider when designing a point-based permissions system like uses?


stack overflow has points-based permissions system determines lot of things on site, such can edit , ability add new tags system.

what advice, regards architectural implementation, give designing such system? store permissions? how use these permissions determine fields appear editable in view? there open-source code examples study from?

with regards ownership or sharing of object model such question or document, pros/cons of storing reference owner on object's model versus storing reference object in account model? e.g.

document = { id:          21234,              owner_id:    4d3ca9f1c067,              shared_with: [a50d1e000138, 4d3ca9f1c067a, 50d1e000138] } 

vs.

user = { id:              4d3ca9f1c067,          documents_owned: [21234, 31452, 12312],          collaborates_on: [23432, 43642, 12314, 23453] } 

store permission in separate model permission-required points pairs.

in view, determine whether logged-in user has sufficient permissions per item display, referring permissions model described above.

model options: i'd prefer former since (1) has simpler, flatter structure, no nested loops through user table when listing questions, , (2) deleting document not entail updating user object. (unless score drops when doc deleted or such.)


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -