Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Blank app running Devise with Admin Role
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
lib/tasks
public
script
test
vendor/plugins
.gitignore
Gemfile
Gemfile.lock
README
Rakefile
config.ru

README

Blank app with authentication powered by Devise. User registration is disabled to the public, only registered users who have admin privileges can create users. Registered (non-admin) users will only be able to change their own password, all user registration and modification is handled by the admin. The ability to disable users (is_active) is also provided.

To create a new user:

1. rails c
2. user = User.new(:name => 'Your Name', :email => 'youremail@gmail.com', :password => 'password', :password_confirmation => 'password')
user.save

Right now is_admin is protected, so you will need to manually give your first user admin privileges (e.g. update users set is_admin="1" where id="1")

This app also uses Ryan Bate's solution for dynamic attr_accessible, allowing admin users to do mass-assignment while preventing regular non-admin users from elevating privileges. If you want to add this to your own app:

http://asciicasts.com/episodes/237-dynamic-attr-accessible
Something went wrong with that request. Please try again.