Messaging repo ported to store and cleaned
This commit is contained in:
@@ -6,10 +6,10 @@ import (
|
||||
|
||||
type (
|
||||
Rule struct {
|
||||
RoleID uint64 `json:"roleID,string" db:"rel_role"`
|
||||
Resource Resource `json:"resource" db:"resource"`
|
||||
Operation Operation `json:"operation" db:"operation"`
|
||||
Access Access `json:"access,string" db:"access"`
|
||||
RoleID uint64 `json:"roleID,string"`
|
||||
Resource Resource `json:"resource"`
|
||||
Operation Operation `json:"operation"`
|
||||
Access Access `json:"access,string"`
|
||||
|
||||
// Do we need to flush it to storage?
|
||||
dirty bool
|
||||
|
||||
@@ -24,6 +24,15 @@ func ToStringBoolMap(s []string) (h map[string]bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func ToUint64BoolMap(u []uint64) (h map[uint64]bool) {
|
||||
h = make(map[uint64]bool)
|
||||
for i := 0; i < len(u); i++ {
|
||||
h[u[i]] = true
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func HasString(ss []string, s string) bool {
|
||||
for i := range ss {
|
||||
if ss[i] == s {
|
||||
|
||||
Reference in New Issue
Block a user