# HG changeset patch # User Sverre Rabbelier # Date 1233441141 0 # Node ID 493e7b5d3ab2c1fe027455ade76b3da8700a2b8c # Parent 4bb31d9a58e0d08c25fc12fd5613eb2d061d905b Final changes to the document model With a seperate set of read and write permissions it is possible to very accurately specify the ACL of the document. Patch by: Sverre Rabbelier diff -r 4bb31d9a58e0 -r 493e7b5d3ab2 app/soc/models/document.py --- a/app/soc/models/document.py Sat Jan 31 22:32:01 2009 +0000 +++ b/app/soc/models/document.py Sat Jan 31 22:32:21 2009 +0000 @@ -47,30 +47,26 @@ URL_NAME = 'document' #: field storing the prefix of this document - prefix = db.StringProperty(default='user', - choices=['site','sponsor','program', 'club', 'organization', 'user'], + prefix = db.StringProperty(default='user', required=True, + choices=['site','club', 'sponsor', 'program', 'organization', 'user'], verbose_name=ugettext('Prefix')) prefix.help_text = ugettext( 'Indicates the prefix of the document,' ' determines which access scheme is used.') - #: field storing the access status of this document - # wiki = any user can read and write the document - # public = any user can read, only restricted can write - # member = member can read, only restricted can write - # restricted = restricted can read, only admin can write - # admin = admin can read, only admin can write - # - # example meanings for an organisations: - # admin = ['org_admin'] - # restricted = ['org_admin', 'org_mentor'] - # member = ['org_admin', 'org_mentor', 'org_student'] - # public = anyone - # wiki = anyone - access_status = db.StringProperty(default='restricted', required=True, - choices=['admin','restricted', 'member', 'public', 'wiki'], - verbose_name=ugettext('Access type')) - access_status.help_text = ugettext( + #: field storing the required access to read this document + read_access = db.StringProperty(default='public', required=True, + choices=['admin','restricted', 'member', 'user', 'public'], + verbose_name=ugettext('Read Access')) + read_access.help_text = ugettext( + 'Indicates the state of the document, ' + 'determines the access scheme.') + + #: field storing the required access to write to this document + write_access = db.StringProperty(default='public', required=True, + choices=['admin','restricted', 'member', 'user'], + verbose_name=ugettext('Write Access')) + write_access.help_text = ugettext( 'Indicates the state of the document, ' 'determines the access scheme.')