Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RBAC #76

Closed
Tracked by #142
edobrb opened this issue Aug 31, 2023 · 0 comments · Fixed by #198
Closed
Tracked by #142

RBAC #76

edobrb opened this issue Aug 31, 2023 · 0 comments · Fixed by #198
Labels
discussion We are trying to figure out if this is needed/feasible enhancement New feature or request

Comments

@edobrb
Copy link
Member

edobrb commented Aug 31, 2023

Work in progress...


Specification for RBAC support


Terminology

Role
A role is just a tag. For example ADMIN. A client can have a set of roles attached to some specific domains
Example:

// Is an Admin for the tenant 1 and a maintainer for tenant 2
[
  { role: 'ADMIN', domain: { tenantId: 1 } },
  { role: 'MAINTAINER', domain: { tenantId: 2 } },
]

Domain
A domain is defined as a category to which an entity belongs.

Operation domain
The current operation domain.
Example:

//The operation domain is { tenantId: 2 }
sdk.updateTenant({ id: 2, name: "MyTenant" })

Permission
A permission is a specification fo what some role can do

true | { read: Projection, write: boolean, delete: boolean }

Every Mondrian type can have a map of role -> permission
Example:

{
  Tenant: {
    ADMIN: true, //can do anything
    MAINTAINER: { //can read and write but not delete
      read: true,
      write: false
      delete: false
    }
  },
  User: {
    ADMIN: true //can do anything
    MAINTAINER: { //can only read name
      read: {
        name: true
      }
    }
  }
}

Operation type
read, write or delete


Goal
Before calling a function we must understand if with the given input and context the client can perform the action:

(
  client's roles, 
  types permissions, 
  this operation domain,
  this operation types,
  requested projection
) -> yes / no+reason
@edobrb edobrb added enhancement New feature or request discussion We are trying to figure out if this is needed/feasible labels Aug 31, 2023
@edobrb edobrb mentioned this issue Nov 7, 2023
20 tasks
@edobrb edobrb mentioned this issue Dec 7, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion We are trying to figure out if this is needed/feasible enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant