diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-05-03 14:49:37 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-05-17 20:53:16 +0200 |
commit | 34974258bc3f745c86512319231bad47232fe007 (patch) | |
tree | a6b9b7d7a80282f77471302f0970daced62e0455 /lib/api/v3 | |
parent | ac382b5682dc2d5eea750313c59fb2581af13326 (diff) | |
download | gitlab-ce-34974258bc3f745c86512319231bad47232fe007.tar.gz |
Hide nested group UI/API support for MySQL
This hides/disables some UI elements and API parameters related to
nested groups when MySQL is used, since nested groups are not supported
for MySQL.
Diffstat (limited to 'lib/api/v3')
-rw-r--r-- | lib/api/v3/entities.rb | 5 | ||||
-rw-r--r-- | lib/api/v3/groups.rb | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/api/v3/entities.rb b/lib/api/v3/entities.rb index 56a9b019f1b..101f566f1dd 100644 --- a/lib/api/v3/entities.rb +++ b/lib/api/v3/entities.rb @@ -137,7 +137,10 @@ module API expose :web_url expose :request_access_enabled expose :full_name, :full_path - expose :parent_id + + if ::Group.supports_nested_groups? + expose :parent_id + end expose :statistics, if: :statistics do with_options format_with: -> (value) { value.to_i } do diff --git a/lib/api/v3/groups.rb b/lib/api/v3/groups.rb index 6187445fc8d..2c52d21fa1c 100644 --- a/lib/api/v3/groups.rb +++ b/lib/api/v3/groups.rb @@ -74,7 +74,11 @@ module API params do requires :name, type: String, desc: 'The name of the group' requires :path, type: String, desc: 'The path of the group' - optional :parent_id, type: Integer, desc: 'The parent group id for creating nested group' + + if ::Group.supports_nested_groups? + optional :parent_id, type: Integer, desc: 'The parent group id for creating nested group' + end + use :optional_params end post do |