diff options
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 7cdff1a46f..cfc01936f0 100644 --- a/models/user.go +++ b/models/user.go @@ -478,7 +478,7 @@ func (u *User) DeleteAvatar() error { // IsAdminOfRepo returns true if user has admin or higher access of repository. func (u *User) IsAdminOfRepo(repo *Repository) bool { - has, err := HasAccess(u, repo, AccessModeAdmin) + has, err := HasAccess(u.ID, repo, AccessModeAdmin) if err != nil { log.Error(3, "HasAccess: %v", err) } @@ -487,7 +487,7 @@ func (u *User) IsAdminOfRepo(repo *Repository) bool { // IsWriterOfRepo returns true if user has write access to given repository. func (u *User) IsWriterOfRepo(repo *Repository) bool { - has, err := HasAccess(u, repo, AccessModeWrite) + has, err := HasAccess(u.ID, repo, AccessModeWrite) if err != nil { log.Error(3, "HasAccess: %v", err) } @@ -1103,7 +1103,7 @@ func GetUserByID(id int64) (*User, error) { // GetAssigneeByID returns the user with write access of repository by given ID. func GetAssigneeByID(repo *Repository, userID int64) (*User, error) { - has, err := HasAccess(&User{ID: userID}, repo, AccessModeWrite) + has, err := HasAccess(userID, repo, AccessModeWrite) if err != nil { return nil, err } else if !has { |