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

Suggestion: rename role to membership #163

Open
gmaclennan opened this issue Jan 30, 2024 · 1 comment
Open

Suggestion: rename role to membership #163

gmaclennan opened this issue Jan 30, 2024 · 1 comment

Comments

@gmaclennan
Copy link
Member

I think the naming here is confusing, especially as we look forwards to allowing projects to define custom roles. What we currently call role is actually a record of a device's membership of a project, and it defines the roleId they have within a project. I think it would make more sense if we call this record type membership, or similar, and then keep the role record type for defining the roles available in a project - a role name, description, and capabilities of that role. Currently these are hard-coded in Mapeo Core as "capabilities".

@EvanHahn

@EvanHahn
Copy link
Contributor

I agree.

In the long term, I see the following data model:

// This is a sketch.
// I'm sure many of the specifics are wrong!

type Project = {
  members: Membership[]
  roles: Role[]
}

type Membership = {
  device: Device
  role: Role
}

type Role = {
  title: string
  capabilities: Capability[]
}

In English: projects have members and roles. There are a small number of roles which can be custom. Each role has certain powers, defined by a list of capabilities.

This is all probably post-MVP.

gmaclennan added a commit that referenced this issue Feb 19, 2024
BREAKING: Fixes Suggestion: rename `role` to `membership` #163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants