From bb6563323ee4d4515f9eda0c9453a21f435445c5 Mon Sep 17 00:00:00 2001 From: Dmitry Ponomarev Date: Wed, 7 Aug 2024 13:38:56 +0200 Subject: [PATCH] Add RBAC type abstraction for ACL checks --- pkg/acl/rbac_type.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pkg/acl/rbac_type.go diff --git a/pkg/acl/rbac_type.go b/pkg/acl/rbac_type.go new file mode 100644 index 0000000..8e11769 --- /dev/null +++ b/pkg/acl/rbac_type.go @@ -0,0 +1,13 @@ +package acl + +// RBACType represents RBAC type abstraction which can replace some non-standard ACL types & checks +type RBACType struct { + AccountID uint64 + UserID uint64 + ResourceName string +} + +// RBACResourceName returns the name of the resource for the RBAC +func (tp *RBACType) RBACResourceName() string { + return tp.ResourceName +}