lundi 26 septembre 2016

EmberJS Authorization and User Roles: Best Practice

Suppose I am building a web application through which users can make and sell hot dogs. I am using EmberJS for the client.

Background:

  1. I am currently implementing authentication using Ember-Simple-Auth, which seems to be a fairly standard library to use with Ember for the purpose of signing in, having user sessions, or tokens.

  2. There are two types of users - cooks and consumers.

  3. I will have my server determining if a specific user is a cook or a eater, and then will be placing that information into a cookie in the page served to the client.

  4. I have a navbar (which is an isolated Ember Component) that will have the home button, and one more button. If the user is a cook, the Cook button must be shown, and the Consumer button will be hidden, and vice-versa if the user is a consumer.

My question is, what is the optimal/recommended way to implement these user roles with Ember Simple Auth?

TLDR: Need to authorize user to access elements in web page based on user role. What is the current recommended way to do this in EmberJS?




Aucun commentaire:

Enregistrer un commentaire