Authorisation management using CanCanCan added
This commit is contained in:
parent
51be4a4777
commit
7a3b65fe50
24 changed files with 211 additions and 295 deletions
|
|
@ -0,0 +1,10 @@
|
|||
class DropDeprecatedScreenshotsFields < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
remove_column :screenshots, :markedfordelete
|
||||
remove_column :screenshots, :delete_reason
|
||||
remove_column :screenshots, :image_file_name
|
||||
remove_column :screenshots, :image_content_type
|
||||
remove_column :screenshots, :image_file_size
|
||||
remove_column :screenshots, :image_updated_at
|
||||
end
|
||||
end
|
||||
14
db/migrate/20210228100636_add_roles_to_users.rb
Normal file
14
db/migrate/20210228100636_add_roles_to_users.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Rename the :admin field to :admin_role and change integer to boolean
|
||||
class AddRolesToUsers < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :users, :admin_role, :boolean, default: false
|
||||
|
||||
User.find_each do |user|
|
||||
user.admin_role=true if user.admin>0
|
||||
user.save!
|
||||
end
|
||||
|
||||
remove_column :users, :admin
|
||||
add_column :users, :moderator_role, :boolean, default: false
|
||||
end
|
||||
end
|
||||
8
db/migrate/20210228191717_add_pseudo_column_to_user.rb
Normal file
8
db/migrate/20210228191717_add_pseudo_column_to_user.rb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# Create a pseudo flag for accounts that get automatically created.
|
||||
# If an anonymous visitor uploads a screenshot he will get a
|
||||
# pseudo account to assign the screenshots to.
|
||||
class AddPseudoColumnToUser < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :users, :pseudo, :boolean, default: false
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue