mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 09:38:09 +01:00
commit
78be8eec65
@ -46,10 +46,24 @@ func GetResourceActions(scopes []string) []*token.ResourceActions {
|
||||
continue
|
||||
}
|
||||
items := strings.Split(s, ":")
|
||||
length := len(items)
|
||||
|
||||
typee := items[0]
|
||||
|
||||
name := ""
|
||||
if length > 1 {
|
||||
name = items[1]
|
||||
}
|
||||
|
||||
actions := []string{}
|
||||
if length > 2 {
|
||||
actions = strings.Split(items[2], ",")
|
||||
}
|
||||
|
||||
res = append(res, &token.ResourceActions{
|
||||
Type: items[0],
|
||||
Name: items[1],
|
||||
Actions: strings.Split(items[2], ","),
|
||||
Type: typee,
|
||||
Name: name,
|
||||
Actions: actions,
|
||||
})
|
||||
}
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user