Skip to content

Commit

Permalink
Fix type permission checks to avoid crashing admin (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes authored and alexander-schranz committed Jul 9, 2019
1 parent 4e24d4e commit e703b47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Resources/public/dist/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Resources/public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ define(['underscore', 'config', 'css!suluarticlecss/main'], function(_, Config)

function types (types) {
var typeList = {};
_.each(types, function(type) {
var permissions = Config.get('sulu_security.contexts')['sulu.modules.articles_' + type.default];
if (permissions['view'] !== false) {
typeList[type.default] = type;
_.each(types, function(config, type) {
var permissions = Config.get('sulu_security.contexts')['sulu.modules.articles_' + type];
if (permissions && permissions['view'] !== false) {
typeList[config.default] = config;
}
});
return typeList;
Expand Down

0 comments on commit e703b47

Please sign in to comment.