Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Allow a way to set user roles for development
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Dec 12, 2018
1 parent 6b94de9 commit 3eb0b7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ rake hydrus:refreshfix RAILS_ENV=test

## Running the application

Run the Hydrus application in either of these ways:
You can provide the current user and roles using environment variables when the server is in development mode:

```bash
rails server
ROLES=dlss:hydrus-app-administrators CURRENT_USER=archivist1@stanford.edu rails server
```

## Useful URLs during development
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def current_user
break unless cur_user
if request.env['eduPersonEntitlement']
cur_user.groups = request.env['eduPersonEntitlement'].split(';')
elsif Rails.env.development? && ENV['ROLES']
cur_user.groups = ENV['ROLES'].split(';')
end
end
end
Expand Down

0 comments on commit 3eb0b7a

Please sign in to comment.