Commit 612d8a57 authored by peterhegman's avatar peterhegman

Add `valid_roles` property to group members

Part of a larger initiative to convert the group members page from
HAML to Vue
parent 262da888
......@@ -44,7 +44,8 @@ module Groups::GroupMembersHelper
id: source.id,
name: source.full_name,
web_url: Gitlab::UrlBuilder.build(source)
}
},
valid_roles: member.valid_level_roles
}.merge(member_created_by_data(member.created_by))
if member.invite?
......
......@@ -22,6 +22,10 @@ class GroupGroupLinkEntity < Grape::Entity
expose :group_access, as: :integer_value
end
expose :valid_roles do |group_link|
group_link.class.access_options
end
expose :shared_with_group do
expose :avatar_url do |group_link|
group_link.shared_with_group.avatar_url(only_path: false)
......
{
"type": "object",
"required": ["id", "created_at", "expires_at", "can_update", "can_remove", "access_level"],
"required": [
"id",
"created_at",
"expires_at",
"can_update",
"can_remove",
"access_level",
"valid_roles"
],
"properties": {
"id": { "type": "integer" },
"created_at": { "type": "date-time" },
......@@ -15,6 +23,7 @@
"string_value": { "type": "string" }
}
},
"valid_roles": { "type": "object" },
"shared_with_group": {
"type": "object",
"required": ["id", "name", "full_name", "full_path", "avatar_url", "web_url"],
......
......@@ -7,6 +7,7 @@
"access_level",
"requested_at",
"source",
"valid_roles",
"can_update",
"can_remove",
"can_override"
......@@ -36,6 +37,7 @@
"web_url": { "type": "string" }
}
},
"valid_roles": { "type": "object" },
"created_by": {
"type": "object",
"required": ["name", "web_url"],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment