It seems I have to implement quite complex permission system and I
want to avoid writing many if- statements... Let me describe:

There are two types of users in the application. Let say users of type
A and B

Users of type A (like a authors of a blog) can create let say a
Document (could be similar to a blog post) Users of type B can add
comments to the document and can do, let say, some actions with the
document.
Users of type A can do some actions with the document too.

Now the actions A-users and B-users depends on:
-attributes of A-user
-attributes of B-user
-attributes of the Document
Imagine something like "only premium members can do this..."

To check all these things with "if" statements will be a nightmare.
I can imagine some state machine driven by a transition table, where
all these attributes of A, B and Document are inputs and the actions
are output.

Any alternatives?
Any ready-to-use state-machine implementation which fits for this
task?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to