summaryrefslogtreecommitdiff
path: root/app/models/group.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix cross-project references copy to include the project referencefix/cross-project-ref-pathJames Lopez2017-01-031-1/+1
| | | | Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
* Merge branch 'dz-nested-group-access' into 'master' Dmitriy Zaporozhets2016-12-291-4/+14
|\ | | | | | | | | Inherit permissions from parent group See merge request !8071
| * Improve Group#users_with_parents methoddz-nested-group-accessDmitriy Zaporozhets2016-12-291-1/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Include group parents into read access for project and groupDmitriy Zaporozhets2016-12-261-4/+14
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Add more storage statisticsMarkus Koller2016-12-211-1/+7
|/ | | | | | | | | | | | | This adds counters for build artifacts and LFS objects, and moves the preexisting repository_size and commit_count from the projects table into a new project_statistics table. The counters are displayed in the administration area for projects and groups, and also available through the API for admins (on */all) and normal users (on */owned) The statistics are updated through ProjectCacheWorker, which can now do more granular updates with the new :statistics argument.
* Use full_name for Group in UIDmitriy Zaporozhets2016-12-131-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Update user's authorized projects if project is allowed to share with groupAhmad Sherif2016-11-231-1/+3
|
* Use the minimum access level of group link and group member when inserting ↵Ahmad Sherif2016-11-231-1/+1
| | | | authorized project records
* Precalculate user's authorized projects in databaseAhmad Sherif2016-11-181-0/+13
| | | | Closes #23150
* Revert "Revert "Change "Group#web_url" to return "/groups/twitter" rather ↵dz-revert-revertDmitriy Zaporozhets2016-10-271-1/+1
| | | | | | than "/twitter"."" This reverts commit 9dbd5b3cfad10b214ae5ef27c39246bbb74a5077.
* Remove redundant class_name and foreign_key overridesDavid Wagner2016-10-241-1/+1
| | | | | | They were Rails' default and are unnecessarily overridden. Signed-off-by: David Wagner <david@marvid.fr>
* Revert "Change "Group#web_url" to return "/groups/twitter" rather than ↵Dmitriy Zaporozhets2016-10-241-1/+1
| | | | | | "/twitter"." This reverts commit c81ff152e08d58c13efbd50c40dd2e083ac65083.
* Change "Group#web_url" to return "/groups/twitter" rather than "/twitter".Adam Niedzielski2016-10-211-1/+1
| | | | | Bring back the old behaviour which was changed by 6b90ccb9. Fixes #23527.
* Add GroupLabel modelDouglas Barbosa Alexandre2016-10-191-0/+1
|
* Allow Member.add_user to handle access requestersRémy Coutable2016-09-281-16/+20
| | | | | | | | | | | | | | | | | | | | | 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>
* Added group-specific setting for LFS.Patricio Cano2016-09-151-0/+7
| | | | Groups can enable/disable LFS, but this setting can be overridden at the project level. Admin only
* Add expiration date to group membershipsSean McGivern2016-08-181-9/+15
|
* Replace optional parameters with keyword arguments.Adam Niedzielski2016-08-021-1/+1
|
* Dumb-down avatar presence check in `avatar_url` methodsRobert Speicher2016-07-051-1/+1
| | | | | | | | | | | | `avatar.present?` goes through CarrierWave, and checks that the file exists on disk and checks its filesize. Because we're hitting the disk, this adds extra overhead to something where the worst-case scenario is rendering a broken image. Instead, we now just check that the _database attribute_ is present, which is good enough for our purposes. See https://gitlab.com/gitlab-org/gitlab-ce/issues/19273
* Exclude requesters from Project#members, Group#members and User#membersexplicit-requesters-scopeRémy Coutable2016-07-011-4/+5
| | | | | | And create new Project#requesters, Group#requesters scopes. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix an information disclosure when requesting access to a group containing ↵Rémy Coutable2016-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | private projects The issue was with the `User#groups` and `User#projects` associations which goes through the `User#group_members` and `User#project_members`. Initially I chose to use a secure approach by storing the requester's user ID in `Member#created_by_id` instead of `Member#user_id` because I was aware that there was a security risk since I didn't know the codebase well enough. Then during the review, we decided to change that and directly store the requester's user ID into `Member#user_id` (for the sake of simplifying the code I believe), meaning that every `group_members` / `project_members` association would include the requesters by default... My bad for not checking that all the `group_members` / `project_members` associations and the ones that go through them (e.g. `Group#users` and `Project#users`) were made safe with the `where(requested_at: nil)` / `where(members: { requested_at: nil })` scopes. Now they are all secure. Signed-off-by: Rémy Coutable <remy@rymai.me>
* Turn Group#owners into a has_many associationYorick Peterse2016-06-161-4/+6
| | | | This allows the owners to be eager loaded where needed.
* UI and copywriting improvements13948-access-request-to-projects-and-groupsRémy Coutable2016-06-141-1/+1
| | | | | | | | | + 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>
* Factorize members mails into a new Emails::Members moduleRémy Coutable2016-06-141-0/+4
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Add request access for groupsRémy Coutable2016-06-141-0/+1
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Remove the annotate gem and delete old annotationsJeroen van Baarsen2016-05-091-17/+0
| | | | | | | | | In 8278b763d96ef10c6494409b18b7eb541463af29 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
* Annotate the modelsZeger-Jan van de Weg2016-05-061-10/+11
|
* Remove useless require 'file_size_validator' causing warningsRémy Coutable2016-04-191-1/+0
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Update NotificationService to use NotificationSettings instead of membershipDmitriy Zaporozhets2016-03-301-0/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Address feedbackDouwe Maan2016-03-221-4/+2
|
* Tweaks, refactoring, and specsDouwe Maan2016-03-201-8/+1
|
* Improve group visibility level featureZeger-Jan van de Weg2016-03-181-0/+22
|
* Merge 4009-external-users into issue_12658Felipe Artur2016-03-161-1/+13
|\
| * Merge branch 'share-project-ce' into 'master' Dmitriy Zaporozhets2016-03-141-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring from EE: Share Project with Group - [x] Models and migrations - [x] Logic, UI - [x] Tests - [x] Documentation - [x] Share with group lock - [x] Api feature - [x] Api docs - [x] Api tests Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> For #12831 cc @DouweM @rspeicher @vsizov See merge request !3186
| | * Bring ProjectGroupLink model and migrations from EEDmitriy Zaporozhets2016-03-111-0/+2
| | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | Removed arel_table receiver from search methodsYorick Peterse2016-03-111-1/+1
| | | | | | | | | | | | | | | We can just use "arel_table" in these cases instead of "SomeClass.arel_table".
| * | Use ILIKE/LIKE for searching groupsYorick Peterse2016-03-111-1/+11
| |/
* | Prevent projects to have higher visibility than groupsFelipe Artur2016-03-101-1/+0
| | | | | | | | | | | | Prevent Groups to have smaller visibility than projects Add default_group_visibility_level to configuration Code improvements
* | Code improvementsFelipe Artur2016-03-101-5/+5
| |
* | Add permission level to groupsFelipe Artur2016-03-101-9/+16
|/
* Make sorting preference reusable for all projects.Rubén Dávila2016-01-221-1/+0
|
* Remember last sort option used.Rubén Dávila2016-01-201-1/+2
|
* Annotate modelsStan Hu2016-01-061-1/+0
|
* remove public field from namespace and refactoringnamespace-clean_upValery Sizov2016-01-041-8/+0
|
* Group methods for filtering public/visible groupsYorick Peterse2015-11-181-0/+8
| | | | | These methods will be used to get a list of groups, optionally restricted to only those visible to a given user.
* Refactor ability changesDouwe Maan2015-11-171-2/+21
|
* Merge branch 'master' into james11/gitlab-ce-removable-group-ownerDouwe Maan2015-11-171-1/+2
|\
| * Annotate modelsDmitriy Zaporozhets2015-11-131-0/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Allow groups to appear in the search results if the group owner allows itValery Sizov2015-11-051-1/+1
| |
* | refactored code as projects only have one owner. Kept some refactoring in ↵James Lopez2015-11-111-5/+1
| | | | | | | | place (has_owners concern)