Add `Project#add_[role]` methods
We do something like this hundreds of times throughout our specs: project.team << [user, :developer]
. It'd be a nicer interface if we could just say project.add_developer(user)
.
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Contributor
@rspeicher since
project.team <<
can be used to add other access levels wdyt about abstracting the method a bit more, something likeproject#add_member(user, access)
:)Edited by username-removed-526579 - Author Owner
@dixpac The idea was that there would be one for each role:
project.add_developer(user) project.add_reporter(user) # etc.
See the Group example in the OP. Or am I misunderstanding?
Edited by Robert Speicher @rspeicher Hi Robert, I'd like to work on this. I'm a newbie here and I would like to get involved in the project.
- username-removed-526579 mentioned in merge request !5990 (closed)
mentioned in merge request !5990 (closed)
- Contributor
@rspeicher yea I didn't understand you initially, I thought you only wanted
add_developer
, anyway I've started to work on this will ping you in next days when I think that is ready - username-removed-44332 mentioned in merge request !5992 (closed)
mentioned in merge request !5992 (closed)
@rspeicher There's MR and it's ready for review https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5992
Edited by username-removed-44332- Robert Speicher Removed ~131895 label
Removed ~131895 label
- Contributor
@itsnikolay @dixpac two MRs in the space of half an hour! https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5990 https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5992 Thanks, we'll only be able to take one though.
@rspeicher my PR has:
- less hardcode
- more OOP (not overweights Project model)
-
current_user
support - unit tests for added methods
Edited by username-removed-44332- username-removed-526579 mentioned in merge request !6012 (closed)
mentioned in merge request !6012 (closed)
- username-removed-44332 mentioned in merge request !6120 (closed)
mentioned in merge request !6120 (closed)
@rspeicher I have created separate MRs with discussed changes:
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5992
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6120 (contains the same hex commit from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5992)
Could you review them, pls? cc @smcgivern , @dixpac
- username-removed-128633 Milestone changed to %8.13
Milestone changed to %8.13
- Robert Speicher Added ~480950 label
Added ~480950 label
- username-removed-443319 Milestone changed to %Backlog
Milestone changed to %Backlog
- Robert Speicher Reassigned to @rspeicher
Reassigned to @rspeicher
- Robert Speicher Mentioned in commit eef36091
Mentioned in commit eef36091
- Robert Speicher Mentioned in merge request !7565 (merged)
Mentioned in merge request !7565 (merged)
- username-removed-443319 Status changed to closed by merge request !7565 (merged)
Status changed to closed by merge request !7565 (merged)
- Nikola Milojevic mentioned in merge request !14785
mentioned in merge request !14785