Commit graph

20 commits

Author SHA1 Message Date
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
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
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
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
Stan Hu
a3157626f1 Re-annotate models 2015-05-03 13:38:27 -07:00
Douwe Maan
e50556fcc8 Let invites be declined. 2015-04-14 12:08:11 +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
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
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