Issue 891: Add virtual group for change set owner or patch set uploader
Status:  Released
Owner: ----
Closed:  Oct 2012

Blocked on:
issue 971
Reported by higeo...@gmail.com, Mar 30, 2011
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)
May 20, 2011
Project Member #1 nas...@grainawi.org
This will be possible through the planned workflow engine support.
Status: Accepted
Blockedon: 971
Oct 25, 2012
#2 JBjo...@gmail.com
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
Project Member #3 ziv...@gmail.com
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
#4 JBjo...@gmail.com
Submitted review request here:
https://gerrit-review.googlesource.com/#/c/38940/
Oct 30, 2012
Project Member #5 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.5
Oct 31, 2012
Project Member #6 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Released