wocao
This commit is contained in:
+1
-18
@@ -1,10 +1,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package state
|
||||
|
||||
import (
|
||||
@@ -15,27 +8,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
|
||||
ErrDenied = errors.New("access denied")
|
||||
|
||||
|
||||
ErrInvalidToken = errors.New("invalid or expired token")
|
||||
|
||||
|
||||
ErrInvalidCredentials = errors.New("invalid username or password")
|
||||
|
||||
ErrRepoNotFound = errors.New("repository not found")
|
||||
|
||||
|
||||
|
||||
ErrNamespaceNotFound = errors.New("namespace does not exist")
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func (s *LocalState) hasAccess(credType CredType, credID, repoID, nsID int64, perm common.Perm) (bool, error) {
|
||||
var acls []ACL
|
||||
err := s.engine.Where("cred_type = ? AND cred_id = ? AND ((target_type = ? AND target_id = ?) OR (target_type = ? AND target_id = ?))",
|
||||
|
||||
Reference in New Issue
Block a user