summaryrefslogtreecommitdiffstats
path: root/models/access.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-03 15:50:55 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-03 15:50:55 -0400
commit79a610592ea7c2e93ab2f91190af1782c4aa8f8d (patch)
tree94515ccd8e27fc7f01c08daea725bdd2f3dbee6a /models/access.go
parentbbadbbdf685a7f6cb1924442a115aa88bb520e07 (diff)
downloadgitea-79a610592ea7c2e93ab2f91190af1782c4aa8f8d.tar.gz
gitea-79a610592ea7c2e93ab2f91190af1782c4aa8f8d.zip
Add: rename repository
Diffstat (limited to 'models/access.go')
-rw-r--r--models/access.go8
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{