mirror of
				https://github.com/Theodor-Springmann-Stiftung/musenalm.git
				synced 2025-10-29 09:15:33 +00:00 
			
		
		
		
	session + user structs, some light refactoring, user roles
This commit is contained in:
		| @@ -22,7 +22,16 @@ func init() { | ||||
| 			Presentable: false, | ||||
| 		} | ||||
|  | ||||
| 		roleField := &core.SelectField{ | ||||
| 			Name:        dbmodels.USERS_ROLE_FIELD, | ||||
| 			Required:    true, | ||||
| 			Presentable: true, | ||||
| 			MaxSelect:   1, | ||||
| 			Values:      []string{"admin", "editor", "viewer"}, | ||||
| 		} | ||||
|  | ||||
| 		collection.Fields.Add(settingsField) | ||||
| 		collection.Fields.Add(roleField) | ||||
|  | ||||
| 		app.Logger().Info("Adding 'settings' JSON field to 'users' collection", "collectionId", collection.Id) | ||||
|  | ||||
| @@ -40,6 +49,7 @@ func init() { | ||||
| 		} | ||||
|  | ||||
| 		collection.Fields.RemoveByName(dbmodels.USERS_SETTINGS_FIELD) | ||||
| 		collection.Fields.RemoveByName(dbmodels.USERS_ROLE_FIELD) | ||||
| 		if err := app.Save(collection); err != nil { | ||||
| 			app.Logger().Warn("Failed to remove 'settings' field during rollback (it might not exist)", | ||||
| 				"collectionId", collection.Id, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Simon Martens
					Simon Martens