python - Django-guardian on DB with shared (non-exclusive) access -
i developing django app being web frontend oracle database local db keeping app's data such guardian permissions. problem can modified different places don't have control of.
let's have 3 models: user
, thesis
, userthesis
.
userthesis
- table specifying relationship between thesis
, user
(user
being co-author of thesis
)
scenario:
user
removed author ofthesis
removing entry inuserthesis
table other app.user
tries modifythesis
using our django app. , succeeds, because guardian , django not know change inuserthesis
.
i thought solutions:
having cron job changes in
userthesis
checking modification date of entry. easy check additions, removals require looking on relationships again.modifying oracle db schema add guardian db tables , creating triggers on
userthesis
table. wouldn't this, because of oracle db being shared among number of different apps.manually checking relationship in views , templates (heavier load on oracle).
which 1 best? other ideas?
i decided go manually checking permissions, caching whenever can. ended get_perms_from_cache(self, user) model method helps me lot.
Comments
Post a Comment