user no stays in cache forever, fix some hubs bugs and add new enpoints
This commit is contained in:
@@ -38,7 +38,7 @@ type User struct {
|
||||
WsConn *websocket.Conn `json:"-"`
|
||||
Id uuid.UUID `json:"-"`
|
||||
Connections map[uuid.UUID]*Connection `json:"-"`
|
||||
Hubs map[uuid.UUID]*Hub `json:"-"`
|
||||
Hubs map[uuid.UUID]*Hub `json:"hubs-to-delete"`
|
||||
Color Rgba `json:"color"`
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ const (
|
||||
CachedUserCanMessage
|
||||
)
|
||||
|
||||
const CachedUserPermissionsAll = CachedUserCanMessage | CachedUserCanReadHistory | CachedUserCanReadHistory
|
||||
const CachedUserPermissionsAll = CachedUserCanView | CachedUserCanReadHistory | CachedUserCanMessage
|
||||
|
||||
func (p *CachedUserPermissions) SetCanView() { *p |= CachedUserCanView }
|
||||
func (p *CachedUserPermissions) ClearCanView() { *p &^= CachedUserCanView }
|
||||
@@ -287,12 +287,11 @@ func NewHub() *Hub {
|
||||
}
|
||||
|
||||
type HubRole struct {
|
||||
Name string `json:"role"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Permissions Permissions `json:"permissions"`
|
||||
Color Rgba `json:"color"`
|
||||
Id uint8 `json:"id"`
|
||||
BoundedGroup uint8 `json:"boundedGroup"` // BoundedGroup 0 for global
|
||||
Name string `json:"role"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Permissions Permissions `json:"permissions"`
|
||||
Color Rgba `json:"color"`
|
||||
Id uint8 `json:"id"`
|
||||
}
|
||||
|
||||
func (h *HubRole) GrantPermission(r Permissions) {
|
||||
|
||||
Reference in New Issue
Block a user