As a user I can set the role of a user
Role should have no effect but simply be assigned to the user.
Current roles are Superadmin, admin, editor and viewer.

NOTES
- Follows same table edit paradigm from existing admin page
- When hovering over a row:
- Role becomes dropdown, enables assignment of new role
- Delete user link appears on rightmost cell
- When
Create Useris clicked:- Create new role at the top of the table
- Editable fields for
Username&Email Address - Role dropdown has default value specified via org settings ( #1831 )
- Save/Cancel buttons in rightmost cell
- Roles & Permissions column is just for reference
- Each section accordions open
- [x] Define
rolesandpermissionsin the context of Chronograf, a la source users (check out InfluxDB and Enterprise implementations for reference)
// Permissions
Permission:
Scope: "dashboards"
Name: DashboardRead
Allowances: "read"
Permission:
Scope: "dashboards"
Name: DashboardWrite
Allowances: "write"
Permission:
Scope: "sources"
Allowances: "read"
Permission:
Scope: "sources"
Allowances: "write"
Permission:
Scope: "rules"
Allowances: "read"
Permission:
Scope: "rules"
Allowances: "write"
Permission:
Scope: "users"
Allowances: "read"
Permission:
Scope: "users"
Allowances: "write"
// Implement Later
Permission:
Scope: "organization"
Allowances: "access"
Permission:
Scope: "organization"
Allowances: "write"
Permission:
Scope: "organizations"
Allowances: "read"
Permission:
Scope: "organizations"
Allowances: "write"
// Roles
// User's current org is higher order logic
Role:
Name: Viewer
Permissions: DashboardRead, SourceRead, RuleRead
Role:
Name: Editor
Permissions: Viewer, DashboardWrite, SourceWrite, RuleWrite
// Implement Later
Role:
Name: Admin
Permissions: Editor, UsersRead/Write, (OrganizationReadWrite?)
Role:
Name: SuperAdmin
Permissions: Admin, OrganizationsRead/Write
@goller something like this seem reasonable?
And then the next step seems to be creating a RolesStore implementation for Bolt, to store the Roles, such that a User's Role can be set.
@desa LGTM
We modified the plan to have Roles be on the User and setting roles by updating the User.
@desa @jaredscheib we don't need all these roles. See the first comment
We've only implemented Admin, Editor, and Viewer so far. They require a concept of Permissions in order to reuse and conform to interfaces and structs that are already in place.
@jaredscheib after discussion with @nhaugo and @goller we're going to remove the granularity of the permissions, so there will be a
View Permission
Which can read dashboards, sources, and rules
Edit Permission
Which can read and write dashboards, sources, and rules
Admin Permission
Which can read and write dashboards, sources, users, and rules
SuperAdmin Permission
Which can read and write dashboards, sources, users, organizations, and rules
The reason for this is so that we don't have to live with fine-grained permissions. Start course, add granularity when we have to.
Whether this is encoded in the logic that authorizes a User for a particular resource, or decoded via explicit Permissions as in the above, the same amount of granularity seems to me to be required in order to perform Viewer, Editor, Admin, and SuperAdmin roles as specified.
I don't have a strong opinion about whether to encode or decode them, but this work is already done and feels more extensible. If we want to go a different path, that's fine with me too.