Implement role authorization
This commit is contained in:
parent
6755328c4c
commit
e2fb434dc7
122 changed files with 1386 additions and 751 deletions
|
|
@ -0,0 +1,10 @@
|
|||
class AddDescriptionAndResourceToRoles < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :roles, :description, :string
|
||||
add_reference :roles, :resource, polymorphic: true
|
||||
|
||||
add_index(:roles, :name)
|
||||
add_index(:roles, [:name, :resource_type, :resource_id])
|
||||
add_index(:roles_users, [:user_id, :role_id])
|
||||
end
|
||||
end
|
||||
5
db/migrate/20140718103856_add_is_admin_to_users.rb
Normal file
5
db/migrate/20140718103856_add_is_admin_to_users.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class AddIsAdminToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :users, :is_admin, :boolean
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue