|
@@ -11,6 +11,16 @@ def make_form(request, role, form):
|
|
|
widget=YesNoSwitch, initial=False, required=False)
|
|
|
form.base_fields['can_handle_reports'] = forms.BooleanField(label=_("Can handle reports"),
|
|
|
widget=YesNoSwitch, initial=False, required=False)
|
|
|
+ form.base_fields['can_upload_report_attachments'] = forms.BooleanField(label=_("Can upload attachments in reports discussions"),
|
|
|
+ widget=YesNoSwitch, initial=False, required=False)
|
|
|
+ form.base_fields['can_download_report_attachments'] = forms.BooleanField(label=_("Can download attachments in reports discussions"),
|
|
|
+ widget=YesNoSwitch, initial=False, required=False)
|
|
|
+ form.base_fields['report_attachment_size'] = forms.IntegerField(label=_("Max size of single attachment in reports discussions (in Kb)"),
|
|
|
+ help_text=_("Enter zero for no limit."),
|
|
|
+ min_value=0, initial=100)
|
|
|
+ form.base_fields['report_attachment_limit'] = forms.IntegerField(label=_("Max number of attachments per post in reports discussions"),
|
|
|
+ help_text=_("Enter zero for no limit."),
|
|
|
+ min_value=0, initial=3)
|
|
|
form.base_fields['can_mod_reports_discussions'] = forms.BooleanField(label=_("Can moderate reports discussions"),
|
|
|
widget=YesNoSwitch, initial=False, required=False)
|
|
|
form.base_fields['can_delete_reports'] = forms.TypedChoiceField(label=_("Can delete reports"),
|
|
@@ -22,7 +32,10 @@ def make_form(request, role, form):
|
|
|
|
|
|
form.fieldsets.append((
|
|
|
_("Reporting Content"),
|
|
|
- ('can_report_content', 'can_handle_reports', 'can_mod_reports_discussions', 'can_delete_reports')
|
|
|
+ ('can_report_content', 'can_handle_reports',
|
|
|
+ 'can_upload_report_attachments', 'can_download_report_attachments',
|
|
|
+ 'report_attachment_size', 'report_attachment_limit',
|
|
|
+ 'can_mod_reports_discussions', 'can_delete_reports')
|
|
|
))
|
|
|
|
|
|
|
|
@@ -48,6 +61,10 @@ def build(acl, roles):
|
|
|
acl.reports = ReportsACL()
|
|
|
acl.reports.acl['can_report_content'] = False
|
|
|
acl.reports.acl['can_handle_reports'] = False
|
|
|
+ acl.reports.acl['can_upload_report_attachments'] = True
|
|
|
+ acl.reports.acl['can_download_report_attachments'] = True
|
|
|
+ acl.reports.acl['report_attachment_size'] = 300
|
|
|
+ acl.reports.acl['report_attachment_limit'] = 6
|
|
|
acl.reports.acl['can_mod_reports_discussions'] = False
|
|
|
acl.reports.acl['can_delete_reports'] = False
|
|
|
|
|
@@ -74,11 +91,10 @@ def cleanup(acl, perms, forums):
|
|
|
'can_make_polls': False,
|
|
|
'can_vote_in_polls': False,
|
|
|
'can_see_poll_votes': False,
|
|
|
- 'can_see_attachments': True,
|
|
|
- 'can_upload_attachments': True,
|
|
|
- 'can_download_attachments': True,
|
|
|
- 'attachment_size': 256,
|
|
|
- 'attachment_limit': 12,
|
|
|
+ 'can_upload_attachments': False,
|
|
|
+ 'can_download_attachments': False,
|
|
|
+ 'attachment_size': 100,
|
|
|
+ 'attachment_limit': 3,
|
|
|
'can_approve': False,
|
|
|
'can_edit_labels': False,
|
|
|
'can_see_changelog': True,
|
|
@@ -101,6 +117,16 @@ def cleanup(acl, perms, forums):
|
|
|
acl.forums.acl['can_see'].append(forum)
|
|
|
acl.forums.acl['can_browse'].append(forum)
|
|
|
acl.threads.acl[forum]['can_pin_threads'] = 2
|
|
|
+ if perm['can_upload_report_attachments']:
|
|
|
+ acl.threads.acl[forum]['can_upload_attachments'] = True
|
|
|
+ if perm['can_download_report_attachments']:
|
|
|
+ acl.threads.acl[forum]['can_download_attachments'] = True
|
|
|
+ if (perm['report_attachment_size'] > acl.threads.acl[forum]['report_attachment_size']
|
|
|
+ and acl.threads.acl[forum]['attachment_size'] != 0):
|
|
|
+ acl.threads.acl[forum]['attachment_size'] = perm['report_attachment_size']
|
|
|
+ if (perm['report_attachment_limit'] > acl.threads.acl[forum]['report_attachment_limit']
|
|
|
+ and acl.threads.acl[forum]['attachment_limit'] != 0):
|
|
|
+ acl.threads.acl[forum]['attachment_limit'] = perm['report_attachment_limit']
|
|
|
if perm['can_mod_reports_discussions']:
|
|
|
acl.threads.acl[forum]['can_edit_threads_posts'] = True
|
|
|
acl.threads.acl[forum]['can_delete_posts'] = 2
|