mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 21:39:40 +02:00
fix(access): support to list users or teams with specified endpoint [EE-1704] (#7610)
This commit is contained in:
parent
f71fe87ba7
commit
53025178ef
25 changed files with 632 additions and 61 deletions
|
@ -113,10 +113,10 @@ func AuthorizedIsAdmin(context *RestrictedRequestContext) bool {
|
|||
return context.IsAdmin
|
||||
}
|
||||
|
||||
// authorizedEndpointAccess ensure that the user can access the specified environment(endpoint).
|
||||
// AuthorizedEndpointAccess ensure that the user can access the specified environment(endpoint).
|
||||
// It will check if the user is part of the authorized users or part of a team that is
|
||||
// listed in the authorized teams of the environment(endpoint) and the associated group.
|
||||
func authorizedEndpointAccess(endpoint *portainer.Endpoint, endpointGroup *portainer.EndpointGroup, userID portainer.UserID, memberships []portainer.TeamMembership) bool {
|
||||
func AuthorizedEndpointAccess(endpoint *portainer.Endpoint, endpointGroup *portainer.EndpointGroup, userID portainer.UserID, memberships []portainer.TeamMembership) bool {
|
||||
groupAccess := AuthorizedAccess(userID, memberships, endpointGroup.UserAccessPolicies, endpointGroup.TeamAccessPolicies)
|
||||
if !groupAccess {
|
||||
return AuthorizedAccess(userID, memberships, endpoint.UserAccessPolicies, endpoint.TeamAccessPolicies)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue