feat: Add user roles, but do not yet enforce them (#1200)

* chore: Rework roles to be expandable by name alone
This commit is contained in:
Steven Masley
2022-04-29 09:04:19 -05:00
committed by GitHub
parent ba4c3ce3b9
commit 35211e2190
26 changed files with 1150 additions and 232 deletions

View File

@ -1,5 +1,9 @@
package rbac
import (
"github.com/google/uuid"
)
const WildcardSymbol = "*"
// Resources are just typed objects. Making resources this way allows directly
@ -46,11 +50,11 @@ func (z Object) All() Object {
}
// InOrg adds an org OwnerID to the resource
func (z Object) InOrg(orgID string) Object {
func (z Object) InOrg(orgID uuid.UUID) Object {
return Object{
ResourceID: z.ResourceID,
Owner: z.Owner,
OrgID: orgID,
OrgID: orgID.String(),
Type: z.Type,
}
}