| Issue 891: | Add virtual group for change set owner or patch set uploader | |
| 3 people starred this issue and may be notified of changes. | Back to list |
It would be useful to have a way to specify the owner of a change set or the uploader of a patch set in the permissions. That would allow to implement a workflow where only the owner/creator of a change set can submit a reviewed change set. (see http://groups.google.com/group/repo-discuss/browse_thread/thread/cbf10b5a664f1e25/42b4606969abd0e8#42b4606969abd0e8)
Oct 25, 2012
This is trivial to implement with the prolog submit rule engine.
Not sure if the example is good enough to save in the cookbook, what do you guys think?
submit_rule(S) :-
gerrit:default_submit(In),
In =.. [submit | Ls],
only_allow_author_to_submit(Ls, R),
S =.. [submit | R].
only_allow_author_to_submit(S1,S2) :-
gerrit:commit_author(Id),
gerrit:current_user(Id),
!,
S2 = S1.
only_allow_author_to_submit(S1, [label('Only-Author-Is-Authorized-To-Submit', need(_)) | S1]).
Oct 26, 2012
The example seems OK. I would only change the label name to 'Patchset-Author'.
Also, the first only_allow_author_to_submit predicate could be simplified:
only_allow_author_to_submit(S,S) :-
gerrit:commit_author(Id),
gerrit:current_user(Id),
!.
Oct 26, 2012
Submitted review request here: https://gerrit-review.googlesource.com/#/c/38940/
Oct 30, 2012
(No comment was entered for this change.)
Status:
Submitted
Labels: FixedIn-2.5
Oct 31, 2012
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |
Blockedon: 971