From 3eb1ab9e8b12a80096d6b10a7f0a398aec8d8172 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 17 Feb 2014 18:38:50 -0500 Subject: Add UI for register user --- models/access.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'models/access.go') diff --git a/models/access.go b/models/access.go index 11bb360a..ea5cbfaa 100644 --- a/models/access.go +++ b/models/access.go @@ -1,3 +1,7 @@ +// Copyright 2014 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + package models import ( @@ -6,8 +10,8 @@ import ( ) const ( - Readable = iota + 1 - Writable + AU_READABLE = iota + 1 + AU_WRITABLE ) type Access struct { @@ -24,6 +28,11 @@ func AddAccess(access *Access) error { } // if one user can read or write one repository -func HasAccess(userName, repoName, mode string) (bool, error) { - return orm.Get(&Access{0, strings.ToLower(userName), strings.ToLower(repoName), mode}) +func HasAccess(userName, repoName string, mode int) (bool, error) { + return orm.Get(&Access{ + Id: 0, + UserName: strings.ToLower(userName), + RepoName: strings.ToLower(repoName), + Mode: mode, + }) } -- cgit v1.2.3