Commit graph

29 commits

Author SHA1 Message Date
Robert Speicher
fcb37542e7 Use :empty_project where possible in model specs 2017-01-26 17:44:59 -05:00
Ahmad Sherif
2ea5ef0ba4 Update ProjectTeam#fetch_members to use project authorizations 2016-11-23 12:59:13 +02:00
Ahmad Sherif
747959a832 Update ProjectTeam#max_member_access_for_user_ids to use project authorizations 2016-11-23 12:59:13 +02:00
Ahmad Sherif
916332815e Drop Project#authorized_for_user? in favor of ProjectTeam#member?
Closes #23938
2016-11-23 12:57:58 +02:00
Robert Speicher
eef3609123 Add shortcuts for adding users to a project team with a specific role
This also updates _some_ specs to use these new methods, just to serve
as an example for others going forward, but by no means is this
exhaustive.

Original implementations at !5992 and !6012.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20944
2016-11-18 14:55:04 +02:00
Nick Thomas
d211011698 Make access request specs explicitly enable or disable access requests as required 2016-11-11 15:45:47 +00:00
Rémy Coutable
178e2758f6 Fix specs that requires an access request
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-09-22 11:12:17 +02:00
Robert Speicher
6f558121b4 Fix a logic error in ProjectTeam#fetch_invited_members
We were calling `.where` and `.send` on the relation, but never doing
anything with the return value, resulting in proper access-level
filtering never being of any consequence.
2016-09-20 21:48:58 +03:00
Robert Speicher
b674ab529a Add specs for ProjectTeam#fetch_members 2016-09-20 15:18:11 +03:00
Stan Hu
99c02ed53c Only use RequestStore in ProjectTeam#max_member_access_for_user if it is active 2016-08-01 13:11:45 -07:00
Stan Hu
ba192c73cd Rubocop offenses 2016-07-26 17:05:52 -07:00
Stan Hu
1fba07109f Optimize the invited group link access level check 2016-07-26 16:56:06 -07:00
Stan Hu
d1ea2bca61 Optimize maximum user access level lookup in loading of notes
NotesHelper#note_editable? and ProjectTeam#human_max_access currently
take about 16% of the load time of an issue page. This MR preloads
the maximum access level of users for all notes in issues and merge
requests with several queries instead of one per user and caches
the result in RequestStore.
2016-07-26 15:33:05 -07: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
Douglas Barbosa Alexandre
b56c456750 Project members with guest role can't access confidential issues 2016-06-13 19:32:00 -03:00
Dmitriy Zaporozhets
55ceda1204
Bring shared project feature tests from EE
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-03-12 14:45:14 +01:00
Robert Speicher
924463907d Allow ProjectTeam#human_max_access to return "Owner" 2016-02-18 16:39:59 -05:00
Douwe Maan
1e8d703a85 Tag model specs 2015-12-09 10:50:51 +01:00
Valery Sizov
97e6c9b42c Wrong access level badge on MR comments 2015-10-02 15:11:17 +03:00
Robert Speicher
fb6dc1f07d Add Group#add_* convenience methods
Encapsulates the logic for `Gitlab::Access::WHATEVER` levels.
2015-08-07 00:20:02 -04:00
Robert Speicher
56246b70fb Fix Style/TrailingBlankLines cop violations 2015-06-22 14:38:33 -04: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
Valery Sizov
47f539f5a6 Snippets: public/internal/private 2014-10-09 17:09:53 +03:00
Dmitriy Zaporozhets
0771109bb8
Fix permission issue with highest access level for group
If user was a member of both group and project and group access level
was higher it was not respected and user got lowest project access
level. Now it is fixed and user get highest access level

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-20 12:54:03 +03:00
Jeroen van Baarsen
a705d194fa Fixed the project team specs
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2014-06-08 23:36:09 +02:00
Dmitriy Zaporozhets
c283fba3b7
Improve performance of application for large teams
This commit fixes a lot of sql queries to db for for groups and projects
with big amount of members.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-04 11:52:17 +03:00
Dmitriy Zaporozhets
9c252a60c1 remove tests for unexisting methods 2013-02-26 11:17:02 +02:00
Andrey Kumanyaev
b8dadd6427 repair rspec (remove and rename files) 2013-01-24 22:31:25 +02:00
Renamed from spec/models/team_spec.rb (Browse further)