mirror of
https://github.com/cuigh/swirl
synced 2025-06-26 18:16:50 +00:00
Refactor authentication & authorization modules
This commit is contained in:
@@ -2,6 +2,8 @@ package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
)
|
||||
|
||||
type UserType string
|
||||
@@ -13,8 +15,6 @@ const (
|
||||
UserTypeLDAP UserType = "ldap"
|
||||
)
|
||||
|
||||
var Placeholder = struct{}{}
|
||||
|
||||
type UserStatus int32
|
||||
|
||||
const (
|
||||
@@ -80,7 +80,7 @@ func NewAuthUser(user *User, roles []*Role) *AuthUser {
|
||||
}
|
||||
for _, role := range roles {
|
||||
for _, perm := range role.Perms {
|
||||
u.perms[perm] = Placeholder
|
||||
u.perms[perm] = data.Empty
|
||||
}
|
||||
}
|
||||
return u
|
||||
|
||||
Reference in New Issue
Block a user