diff --git a/rbac/acl.go b/rbac/acl.go new file mode 100644 index 000000000..68322d057 --- /dev/null +++ b/rbac/acl.go @@ -0,0 +1,25 @@ +package rbac + +import "google.golang.org/genproto/googleapis/type/datetime" + +type ACLResource int32 + +const ( + Index ACLResource = iota +) + +type ACLAction int32 + +const ( + Read ACLAction = iota + Write + Update + Grant +) + +type ACL struct { + User *FBUser + Resource ACLResource + CreatedBy *FBUser + Created datetime.DateTime +} diff --git a/rbac/example.yaml b/rbac/example.yaml new file mode 100644 index 000000000..bc4d1a95c --- /dev/null +++ b/rbac/example.yaml @@ -0,0 +1,19 @@ +--- +user: + name: fletcher + email: fletcher.haynes@featurebase.com + +--- +group: + name: employees + members: [ + fletcher + ] + +--- +role: + name: administrators + members: [ + fletcher + ] + diff --git a/rbac/user.go b/rbac/user.go new file mode 100644 index 000000000..b2115167d --- /dev/null +++ b/rbac/user.go @@ -0,0 +1,19 @@ +package rbac + +import "google.golang.org/genproto/googleapis/type/datetime" + +type FBUserStatus int32 + +const ( + Active FBUserStatus = 0 + Disabled + Locked +) + +type FBUser struct { + Username string + Email string + Created datetime.DateTime + LastActivity datetime.DateTime + Status FBUserStatus +}