Add customizable user roles (#18641)
* Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management
This commit is contained in:
		
							parent
							
								
									1b4054256f
								
							
						
					
					
						commit
						44b2ee3485
					
				
					 187 changed files with 1945 additions and 1032 deletions
				
			
		
							
								
								
									
										8
									
								
								db/migrate/20220611212541_add_role_id_to_users.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								db/migrate/20220611212541_add_role_id_to_users.rb
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,8 @@ | |||
| class AddRoleIdToUsers < ActiveRecord::Migration[6.1] | ||||
|   disable_ddl_transaction! | ||||
| 
 | ||||
|   def change | ||||
|     safety_assured { add_reference :users, :role, foreign_key: { to_table: 'user_roles', on_delete: :nullify }, index: false } | ||||
|     add_index :users, :role_id, algorithm: :concurrently, where: 'role_id IS NOT NULL' | ||||
|   end | ||||
| end | ||||
		Reference in a new issue