Commit graph

22 commits

Author SHA1 Message Date
Rémy Coutable
ec0061a95c Allow Member.add_user to handle access requesters
Changes include:

- Ensure Member.add_user is not called directly when not necessary
- New GroupMember.add_users_to_group to have the same abstraction level as for Project
- Refactor Member.add_user to take a source instead of an array of members
- Fix Rubocop offenses
- Always use Project#add_user instead of project.team.add_user
- Factorize users addition as members in Member.add_users_to_source
- Make access_level a keyword argument in GroupMember.add_users_to_group and ProjectMember.add_users_to_projects
- Destroy any requester before adding them as a member
- Improve the way we handle access requesters in Member.add_user
  Instead of removing the requester and creating a new member,
  we now simply accepts their access request. This way, they will
  receive a "access request granted" email.
- Fix error that was previously silently ignored
- Stop raising when access level is invalid in Member, let Rails validation do their work

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-28 09:43:00 +02:00
Valery Sizov
8b2dbe8997 Remove schema annotations completely 2016-09-16 14:37:48 +03:00
http://jneen.net/
5853c96b49 remove Ability.abilities 2016-08-30 11:35:06 -07:00
http://jneen.net/
99ee86206e remove six, and use a Set instead 2016-08-30 11:32:55 -07:00
Rémy Coutable
29850364ec New AccessRequests API endpoints for Group & Project
Also, mutualize AccessRequests and Members endpoints for Group &
Project.
New API documentation for the AccessRequests endpoints.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-08-10 19:07:05 +02:00
tiagonbotelho
1d268a89de adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
Herminio Torres
f15ed5f0a5
Fix Rename add_users_into_project and projects_ids
We never add things `into` projects, we just add them `to` projects. So how about we rename this to `add_users_to_project`.

Rename `projects_ids` to `project_ids` by following the convention of rails.
2016-08-04 08:55:50 -03:00
Robert Speicher
adc6ec4a9c Avoid describe-ing symbols in specs 2016-07-12 10:27:58 -05:00
Grzegorz Bizon
9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Rémy Coutable
4652489f40 New Members::DestroyService
This is to ensure we don't send unwanted notifications when deleting a
project. In other words, stop abusing AR callbacks and use services.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-18 05:46:45 +02:00
Rémy Coutable
515205d3c1 UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:18:14 +02:00
Rémy Coutable
d26f81239a Add request access for groups
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-06-14 13:07:26 +02:00
Long Nguyen
e55ba527b8 Fix broken specs 2016-05-21 23:11:26 +07:00
Long Nguyen
bfbbb182c1 Fix broken specs 2016-05-21 17:20:44 +07:00
Long Nguyen
ad17741008 Remove todos when destroy project member and specs 2016-05-21 00:37:48 +07:00
Douwe Maan
1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Dmitriy Zaporozhets
342d553709
Rename abilities to correspond contoller/model action names
write_ was renamed to create_
modify_  was renamed to update_

So now in update action we have next code

def create
  can?(current_user, :create_issue, @issue)
end

def update
  can?(current_user, :update_issue, @issue)
end

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-26 15:55:56 +02:00
Robert Speicher
5a9ede4721 Update mock and stub syntax for specs 2015-06-22 12:13:46 +02:00
Stan Hu
a3157626f1 Re-annotate models 2015-05-03 13:38:27 -07:00
Douwe Maan
99f995755e Use group_member instead of users_group or membership. 2015-03-15 13:49:41 +01:00
Jeroen van Baarsen
0c4a70a306 Updated rspec to rspec 3.x syntax
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-02-12 19:17:35 +01:00
Robert Speicher
ab6f7164e0 Make the structure of spec/models match app/models 2015-01-30 15:51:10 -05:00