|
|
@ -36,7 +36,10 @@ func accessLevel(e Engine, u *User, repo *Repository) (AccessMode, error) { |
|
|
|
mode = ACCESS_MODE_READ |
|
|
|
mode = ACCESS_MODE_READ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if u != nil { |
|
|
|
if u == nil { |
|
|
|
|
|
|
|
return mode, nil |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if u.Id == repo.OwnerID { |
|
|
|
if u.Id == repo.OwnerID { |
|
|
|
return ACCESS_MODE_OWNER, nil |
|
|
|
return ACCESS_MODE_OWNER, nil |
|
|
|
} |
|
|
|
} |
|
|
@ -46,9 +49,6 @@ func accessLevel(e Engine, u *User, repo *Repository) (AccessMode, error) { |
|
|
|
return mode, err |
|
|
|
return mode, err |
|
|
|
} |
|
|
|
} |
|
|
|
return a.Mode, nil |
|
|
|
return a.Mode, nil |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mode, nil |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// AccessLevel returns the Access a user has to a repository. Will return NoneAccess if the
|
|
|
|
// AccessLevel returns the Access a user has to a repository. Will return NoneAccess if the
|
|
|
|