mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 16:49:04 +01:00
44b2ee3485
* Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management
9 lines
354 B
Ruby
9 lines
354 B
Ruby
# Pre-create base role
|
|
UserRole.everyone
|
|
|
|
# Create default roles defined in config file
|
|
default_roles = YAML.load_file(Rails.root.join('config', 'roles.yml'))
|
|
|
|
default_roles.each do |_, config|
|
|
UserRole.create_with(position: config['position'], permissions_as_keys: config['permissions'], highlighted: true).find_or_create_by(name: config['name'])
|
|
end
|