mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: add sql filter to fetching audit logs (#14070)
* chore: add sql filter to fetching audit logs * use sqlc.embed for audit logs * fix sql query matcher
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/oauth2"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -101,6 +102,19 @@ func (g Group) Auditable(users []User) AuditableGroup {
|
||||
|
||||
const EveryoneGroup = "Everyone"
|
||||
|
||||
func (w GetAuditLogsOffsetRow) RBACObject() rbac.Object {
|
||||
return w.AuditLog.RBACObject()
|
||||
}
|
||||
|
||||
func (w AuditLog) RBACObject() rbac.Object {
|
||||
obj := rbac.ResourceAuditLog.WithID(w.ID)
|
||||
if w.OrganizationID != uuid.Nil {
|
||||
obj = obj.InOrg(w.OrganizationID)
|
||||
}
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
func (s APIKeyScope) ToRBAC() rbac.ScopeName {
|
||||
switch s {
|
||||
case APIKeyScopeAll:
|
||||
|
||||
Reference in New Issue
Block a user