vj4
vj4 copied to clipboard
Support setting record publicity
#230
- [x] Add option to change "default source code publicity" in user preference (@breeswish)
- [x] Allow overridding the publicity for specific submission when submitting [deprecated: user can change publicity after submission] (@breeswish)
- [x] Allow changing publicity for specific submission in submission_detail (@breeswish)
- [x] Check publicity according to new rules (@twd2)
Domain overriding publicity setting is intended to be out of this PR's scope.
Discuss: is EDIT_RECORD_VISIBILITY(_SELF) a perm or a priv?
I think "publicity" is more accurate than "visibility".
EDIT_RECORD_VISIBILITY(_SELF) should be a permission since the domain owner may want to set some record's source code to public for others to refer to, for example, after a contest.
inference: records should be assigned a domain? domain-scoped records have many advantages, for example, allowing domain owner to view all records.
According to our design before, records are global. ^_^ T_T
@iceb0y
@iceb0y ptal
Looks like this change makes the visibility mutable (can be changed after a record is created) and doesn't provide an option to set this on submission time. I think we should first allow user to set this on submission time but disallow user to change this once record is created.
@iceb0y I think providing an extra option for overriding visibility might be not helpful and is a bit confusion for most of the users. It is a special use case so that it is not provided in the submission page. However users are more likely to change the visibility after submission though, because of knowing whether the submission is Accepted or not.
We could restrict the mutation for submissions older than a specific time (i.e. one month) to prevent history db records being modified. This restriction still meet demands for new submissions and it only affects users who wish to change the visibility for history submissions.