Skip to content
Permalink
Browse files

BUG If a nested page editable but parent not, user can't expand tree

If you're logged in as a specific user in a group who has view/edit
permissions of a page that has a parent page which doesn't have
permissions, you can't expand the tree node to get access to that
nested page.

This fixes LeftAndMain.Tree.js to allow expanding if there are
immediate children tree nodes that are not disabled. Also fixes
styling so that only immediate children nodes are greyed out.

Fixes this ticket: http://open.silverstripe.org/ticket/7913
  • Loading branch information...
halkyon committed Sep 28, 2012
1 parent a86b54b commit b186626b73454cc36a74d04a8950cdd410b96cc6
Showing with 8 additions and 5 deletions.
  1. +1 −1 admin/css/screen.css
  2. +5 −2 admin/javascript/LeftAndMain.Tree.js
  3. +2 −2 admin/scss/_tree.scss

Some generated files are not rendered by default. Learn more.

@@ -75,9 +75,12 @@
}

if($.inArray(data.func, ['check_node', 'uncheck_node'])) {
//Don't allow check and uncheck if parent is disabled
// don't allow check and uncheck if parent is disabled
var node = $(data.args[0]).parents('li:first');
if(node.hasClass('disabled')) {
var allowedChildren = node.find('li:not(.disabled)');

// if there are child nodes that aren't disabled, allow expanding the tree
if(node.hasClass('disabled') && allowedChildren == 0) {
e.stopImmediatePropagation();
return false;
}
@@ -75,7 +75,7 @@
}

}
li.disabled a {
li.disabled > a {
color: #aaaaaa;
}

@@ -638,4 +638,4 @@ li.class-ErrorPage > a .jstree-pageicon {
a.jstree-loading .jstree-pageicon {
background: url(../images/throbber.gif) top left no-repeat;
}
}
}

0 comments on commit b186626

Please sign in to comment.
You can’t perform that action at this time.