mirror of
https://github.com/portainer/portainer.git
synced 2025-07-29 10:19:41 +02:00
This reverts commit 12cf4a00f0
.
This commit is contained in:
parent
12cf4a00f0
commit
2f95b449aa
18 changed files with 18 additions and 410 deletions
|
@ -160,13 +160,9 @@ func FilterAuthorizedCustomTemplates(customTemplates []portainer.CustomTemplate,
|
|||
return authorizedTemplates
|
||||
}
|
||||
|
||||
// UserCanAccessResource will valid that a user has permissions defined in the specified resource control
|
||||
// UserCanAccessResource will valide that a user has permissions defined in the specified resource control
|
||||
// based on its identifier and the team(s) he is part of.
|
||||
func UserCanAccessResource(userID portainer.UserID, userTeamIDs []portainer.TeamID, resourceControl *portainer.ResourceControl) bool {
|
||||
if resourceControl == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, authorizedUserAccess := range resourceControl.UserAccesses {
|
||||
if userID == authorizedUserAccess.UserID {
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue