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

Create user roles #105

Closed
5 tasks done
bajiat opened this issue Jun 9, 2015 · 10 comments
Closed
5 tasks done

Create user roles #105

bajiat opened this issue Jun 9, 2015 · 10 comments
Assignees
Milestone

Comments

@bajiat
Copy link
Contributor

bajiat commented Jun 9, 2015

Create user roles for API user, API administrator and system administrator and document their privileges

Definition of done

  • Create roles corresponding to our Personas' user roles
  • Create document describing roles and expected privileges
  • Define user roles in code, possibly on Startup
  • Decide how system administrators will manage user roles
  • Add roles collection and field to user administration interface
@JuusoV JuusoV self-assigned this Jun 15, 2015
@brylie brylie added this to the Sprint 5 milestone Jun 15, 2015
@brylie
Copy link
Contributor

brylie commented Jun 17, 2015

@JuusoV, check out the following learning resources demonstrating the alanning:roles package:

@brylie
Copy link
Contributor

brylie commented Jun 17, 2015

The alanning:roles API documentation indicates there is a createRole method. We may be able to create the roles on Meteor.startup() using Roles.createRole('role-name') one or more times.

@brylie
Copy link
Contributor

brylie commented Jun 17, 2015

It could also be possible to verify the roles before creating them, to avoid creating duplicates, by using the Roles.getAllRoles() method and checking each returned role for a duplicate.

We have a similar pattern for avoiding duplicates in the ApiBackends collection.

@brylie
Copy link
Contributor

brylie commented Jun 17, 2015

Also, refer to the Best Practices section of the roles demonstration video, where Adrian Lanning explains conventions for creating roles. This may influence how we implement roles in our project.

@JuusoV
Copy link
Contributor

JuusoV commented Jun 18, 2015

Roles.createRole('role-name') works under Meteor.startup(). The created roles shown in the console with Roles.getAllRoles().find().fetch()

@brylie
Copy link
Contributor

brylie commented Jun 18, 2015

@JuusoV please review the similar pattern for avoiding duplicates in the ApiUmbrellaAdmins collection. You will have to take the general pattern and modify it to work with your task.

@JuusoV
Copy link
Contributor

JuusoV commented Jun 18, 2015

I got the roles working but I think we should not impelement them in the startup because the roles are only created once. Do you agree?

@brylie
Copy link
Contributor

brylie commented Jun 18, 2015

Where should we implement them?

On 18 June 2015 17:02:00 EEST, Juuso Vallius notifications@github.com wrote:

I got the roles working but I think we should not impelement them in
the startup because the roles are only created once. Do you agree?


Reply to this email directly or view it on GitHub:
https://github.com/apinf/api-umbrella-dashboard/issues/105#issuecomment-113166154

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@brylie
Copy link
Contributor

brylie commented Jun 22, 2015

@JuusoV consider the Add Roles Collection to Admin Dashboard. This is a simple and flexible recipe to add a 'Roles' button to the admin dashboard, where we can easily manage the Meteor.roles collection. It will satisfy the final step in this task.

@JuusoV
Copy link
Contributor

JuusoV commented Jun 22, 2015

Thanks for the help and support @brylie.
Task is now done and PR is created.
Estimate: 0

@JuusoV JuusoV closed this as completed Jun 22, 2015
brylie added a commit that referenced this issue Dec 20, 2016
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

3 participants