artsy / team-navigator

An internal HR product for Artsy's team
https://team.artsy.net
MIT License
62 stars 19 forks source link

Use 'team' role for authorization instead of 'admin' #135

Closed joeyAghion closed 4 years ago

joeyAghion commented 4 years ago

Related to PLATFORM-1863 and dependent on https://github.com/artsy/gravity/pull/12781.

Let's not require that all employees have the powerful admin role just to access company resources.

Admittedly, I'm making this change a little blind. I had some local lint-ing and testing failures, and I'm not even sure if this app has a staging environment or how it's deployed. Any insight there?

dblandin commented 4 years ago

I had some local lint-ing and testing failures, and I'm not even sure if this app has a staging environment or how it's deployed. Any insight there?

Re: staging

This app doesn't currently have a staging environment. We could probably set something up on Heroku without too much effort: https://devcenter.heroku.com/articles/multiple-environments#creating-and-linking-environments

Re: deployment

Heroku automatically deploys master whenever a new commit is pushed/merged.

Screenshot from 2020-02-19 16-00-38

https://dashboard.heroku.com/apps/artsy-team-navigator/deploy/github


If you'd like to test your changes against production config/data before merging, you could do the following:

  1. Pull down the production config

    $ heroku config --app artsy-team-navigator --shell > .env.local
  2. Update the following configuration values:

    APP_URL='http://localhost:3000'
    NO_SYNCING=true
    PORT=3000
    NODE_ENV=development
  3. Run the v2 app, linking to the production database

$ heroku local:run --env .env.local yarn run v2
dblandin commented 4 years ago

@joeyAghion Going to assign this back to you so you can merge when ready. :+1:

joeyAghion commented 4 years ago

I ran into infinite redirects testing locally with production's config, so I'll merge this and roll back if necessary.

dblandin commented 4 years ago

I ran into infinite redirects testing locally with production's config, so I'll merge this and roll back if necessary.

@joeyAghion Sounds good! The infinite redirect issue has happened to me when I'm already logged into an Artsy account without proper authorization to Team Nav. I don't think the app handles that case well today.