app/soc/models/document.py
changeset 1134 493e7b5d3ab2
parent 1095 0122dc66e5d2
child 1141 4a37239d834f
equal deleted inserted replaced
1133:4bb31d9a58e0 1134:493e7b5d3ab2
    45   """
    45   """
    46 
    46 
    47   URL_NAME = 'document'
    47   URL_NAME = 'document'
    48 
    48 
    49   #: field storing the prefix of this document
    49   #: field storing the prefix of this document
    50   prefix = db.StringProperty(default='user',
    50   prefix = db.StringProperty(default='user', required=True,
    51       choices=['site','sponsor','program', 'club', 'organization', 'user'],
    51       choices=['site','club', 'sponsor', 'program', 'organization', 'user'],
    52       verbose_name=ugettext('Prefix'))
    52       verbose_name=ugettext('Prefix'))
    53   prefix.help_text = ugettext(
    53   prefix.help_text = ugettext(
    54       'Indicates the prefix of the document,'
    54       'Indicates the prefix of the document,'
    55       ' determines which access scheme is used.')
    55       ' determines which access scheme is used.')
    56 
    56 
    57   #: field storing the access status of this document
    57   #: field storing the required access to read this document
    58   # wiki = any user can read and write the document
    58   read_access = db.StringProperty(default='public', required=True,
    59   # public = any user can read, only restricted can write
    59       choices=['admin','restricted', 'member', 'user', 'public'],
    60   # member = member can read, only restricted can write
    60       verbose_name=ugettext('Read Access'))
    61   # restricted = restricted can read, only admin can write
    61   read_access.help_text = ugettext(
    62   # admin = admin can read, only admin can write
    62       'Indicates the state of the document, '
    63   #
    63       'determines the access scheme.')
    64   # example meanings for an organisations:
    64 
    65   # admin = ['org_admin']
    65   #: field storing the required access to write to this document
    66   # restricted = ['org_admin', 'org_mentor']
    66   write_access = db.StringProperty(default='public', required=True,
    67   # member = ['org_admin', 'org_mentor', 'org_student']
    67       choices=['admin','restricted', 'member', 'user'],
    68   # public = anyone
    68       verbose_name=ugettext('Write Access'))
    69   # wiki = anyone
    69   write_access.help_text = ugettext(
    70   access_status = db.StringProperty(default='restricted', required=True,
       
    71       choices=['admin','restricted', 'member', 'public', 'wiki'],
       
    72       verbose_name=ugettext('Access type'))
       
    73   access_status.help_text = ugettext(
       
    74       'Indicates the state of the document, '
    70       'Indicates the state of the document, '
    75       'determines the access scheme.')
    71       'determines the access scheme.')
    76 
    72 
    77   #: field storing whether a link to the Document should be featured in
    73   #: field storing whether a link to the Document should be featured in
    78   #: the sidebar menu (and possibly elsewhere); FAQs, Terms of Service,
    74   #: the sidebar menu (and possibly elsewhere); FAQs, Terms of Service,