API doesn't return the correct group access level for projects inside a subgroup
There seems to be an issue with the API. When I fetch the details for a particular project using the API (https://docs.gitlab.com/ee/api/projects.html#get-single-project), the project details include the permissions the current user has on the project and on the group in the following format, which is perfect.
permissions: {
project_access: {
access_level: 10,
notification_level: 3
},
group_access: {
access_level: 50,
notification_level: 3
}
}
However, if the project is inside a subgroup and the user doesn't have any explicit access defined on the project and the subgroup level, i.e. the access is being inherited from the parent group, the project details do not give the correct picture as far as the access level is concerned.
Consider the case, when the user has Owner (50) access on the group, and no overrides defined at the subgroup and the project level. Project details fetched with the API, show the project access and group access both as null.
permissions: {
project_access: null,
group_access: null
}
It is clear to me that the group_access is what the user has defined on the subgroup in which the project exists.
Shouldn't this group_access for a project inside a subgroup be the final (calculated) access level that the user has for the subgroup, either inherited from the parent group or defined at the subgroup level itself? Or am I missing something here?