From b937ef93711cd2da43cbba425fe36ceb5866ef32 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 18 Oct 2016 18:28:38 +0200 Subject: [PATCH] Improved error handling. --- app/assets/javascripts/app/models/user.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/app/models/user.coffee b/app/assets/javascripts/app/models/user.coffee index 4a19eca1c..71bd25604 100644 --- a/app/assets/javascripts/app/models/user.coffee +++ b/app/assets/javascripts/app/models/user.coffee @@ -195,6 +195,8 @@ class App.User extends App.Model if role.active is true for permission_id in role.permission_ids permission = App.Permission.findNative(permission_id) + if !permission + throw "No such permission for id #{permission_id}" permissions[permission.name] = true for localKey in keys