mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 10:45:45 +01:00
Merge pull request #296 from ywk253100/bug_fix_get_member
bug fix: the length should be 0 when initialize a slice
This commit is contained in:
commit
8206ef2dcb
@ -48,7 +48,7 @@ func hasProjectAdminRole(userID int, projectID int64) bool {
|
||||
|
||||
//sysadmin has all privileges to all projects
|
||||
func listRoles(userID int, projectID int64) ([]models.Role, error) {
|
||||
roles := make([]models.Role, 1)
|
||||
roles := make([]models.Role, 0, 1)
|
||||
isSysAdmin, err := dao.IsAdminRole(userID)
|
||||
if err != nil {
|
||||
return roles, err
|
||||
|
Loading…
Reference in New Issue
Block a user