diff options
author | Unknown <joe2010xtmf@163.com> | 2014-04-03 15:50:55 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-04-03 15:50:55 -0400 |
commit | 79a610592ea7c2e93ab2f91190af1782c4aa8f8d (patch) | |
tree | 94515ccd8e27fc7f01c08daea725bdd2f3dbee6a /models/access.go | |
parent | bbadbbdf685a7f6cb1924442a115aa88bb520e07 (diff) | |
download | gitea-79a610592ea7c2e93ab2f91190af1782c4aa8f8d.tar.gz gitea-79a610592ea7c2e93ab2f91190af1782c4aa8f8d.zip |
Add: rename repository
Diffstat (limited to 'models/access.go')
-rw-r--r-- | models/access.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/access.go b/models/access.go index 42fccae055..83261575e6 100644 --- a/models/access.go +++ b/models/access.go @@ -32,6 +32,14 @@ func AddAccess(access *Access) error { return err } +// UpdateAccess updates access information. +func UpdateAccess(access *Access) error { + access.UserName = strings.ToLower(access.UserName) + access.RepoName = strings.ToLower(access.RepoName) + _, err := orm.Id(access.Id).Update(access) + return err +} + // HasAccess returns true if someone can read or write to given repository. func HasAccess(userName, repoName string, mode int) (bool, error) { return orm.Get(&Access{ |