Commit Graph

45 Commits

Author SHA1 Message Date
http://jneen.net/ 90dd3fb32c a membership with no user is always notifiable
since this is for user invites and the like.
2017-08-11 16:02:04 -07:00
http://jneen.net/ d5054abfcc add Member#notifiable?(type, opts) 2017-08-11 16:02:02 -07:00
Sean McGivern 5db229fb45 Allow group reporters to manage group labels
Previously, only group masters could do this. However, project reporters can
manage project labels, so there doesn't seem to be any need to restrict group
labels further.

Also, save a query or two by getting a single GroupMember object to find out if
the user is a master or not.
2017-06-05 11:58:53 +01:00
Dmitriy Zaporozhets c6960ded8a
Refactor add_users method for project and group
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-04-21 18:38:10 +03:00
Markus Koller a3430f011f Support 2FA requirement per-group 2017-04-06 10:01:13 +02:00
Douwe Maan 5cd9c7c6ea Enable Rails/Validation 2017-02-23 09:31:57 -06:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
David Wagner 03b6108f6f Remove redundant class_name and foreign_key overrides
They were Rails' default and are unnecessarily overridden.

Signed-off-by: David Wagner <david@marvid.fr>
2016-10-24 22:29:48 +02:00
Callum Dryden 9124310f28
Differentiate the expire from leave event
At the moment we cannot see weather a user left a project due to their
membership expiring of if they themselves opted to leave the project.
This adds a new event type that allows us to make this differentiation.
Note that is not really feasable to go back and reliably fix up the
previous events. As a result the events for previous expire removals
will remain the same however events of this nature going forward will be
correctly represented.
2016-10-20 00:26:45 +00:00
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
Sean McGivern 8b1656282b Merge branch 'master' into expiration-date-on-memberships 2016-08-18 15:54:07 +01: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
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
Adam Niedzielski b2c8dc6f35 Replace optional parameters with keyword arguments. 2016-08-02 20:37:22 +02:00
Adam Niedzielski 6d92cd3e83 WIP 2016-08-01 20:12:30 +02: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
David Alexander 17c22156c5 Initial implementation of user access request to projects 2016-06-14 12:12:02 +02:00
Long Nguyen aeb5262d42 Add changelog and code refactor 2016-05-30 22:32:07 +07:00
Long Nguyen 5af7380804 Fix Member spec 2016-05-22 09:32:59 +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
Jeroen van Baarsen f1479b56b7
Remove the annotate gem and delete old annotations
In 8278b763d9 the default behaviour of annotation
has changes, which was causing a lot of noise in diffs. We decided in #17382
that it is better to get rid of the whole annotate gem, and instead let people
look at schema.rb for the columns in a table.

Fixes: #17382
2016-05-09 18:00:28 +02:00
Zeger-Jan van de Weg 47da013cf8 Annotate the models 2016-05-06 08:27:46 +02:00
Dmitriy Zaporozhets 4ca73f56cb Small refactoring and cleanup of notification logic
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-30 10:44:20 +02:00
Douwe Maan 21facf5353 Use consistent markup and styling for highlighting across blobs, diffs, blame and snippets 2016-01-21 14:23:53 +01:00
Stan Hu a3157626f1 Re-annotate models 2015-05-03 13:38:27 -07:00
Douwe Maan cb5362e7ce Follow newline guidelines. 2015-04-14 15:16:00 +02:00
Douwe Maan 0013ea5130 Remove duplication between Group and ProjectMember. 2015-04-14 12:41:19 +02:00
Douwe Maan e50556fcc8 Let invites be declined. 2015-04-14 12:08:11 +02:00
Douwe Maan 87dd3f215f Let members be invited from Add members pane. 2015-04-14 12:08:10 +02:00
Douwe Maan 717fa136a5 Add emails around invitation. 2015-04-14 12:08:10 +02:00
Douwe Maan 629fa7fbe3 Add invite logic to Member. 2015-04-14 12:06:43 +02:00
Douwe Maan 2b2bd402dc Track who created a group or project member. 2015-04-14 12:06:42 +02:00
Douwe Maan 31fc73f0a9 Use `project_member` instead of `team_member`. 2015-03-15 13:50:38 +01:00
Douwe Maan 9b917b4a73 Add "User created project Namespace / Project" event 2015-02-13 12:02:58 +01:00
Douwe Maan 07d05d2df7 Move all event creation to EventCreateService. 2015-02-13 12:02:58 +01:00
Boyan Tabakov 93bc2d5202 Added support for firing system hooks on group create/destroy and adding/removing users to group.
Added tests and updated docs. Also adding 'user_id' field in the hooks for adding/removing user from team.
2015-01-27 09:25:28 +02:00
Valery Sizov 82c938ad75 annotate 2014-10-09 18:22:20 +03:00
Ciro Santilli 2e9f5de868 Add parenthesis to function def with arguments. 2014-10-03 09:18:46 +02:00
Dmitriy Zaporozhets 1aa48174db
Fix STI+polymorphic for Group <-> GroupMember
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 21:52:54 +03:00
Dmitriy Zaporozhets 13af7de941
Fix migration and association for new members table
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 20:38:57 +03:00
Dmitriy Zaporozhets c69b8e0459
Huge replace of old users_project and users_group references
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-14 19:32:51 +03:00