Merge remote-tracking branch 'origin/dev-v7' into dev-v8

Conflicts:
	.gitignore
	build/UmbracoVersion.txt
	src/Umbraco.Core/Configuration/UmbracoVersion.cs
	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
	src/Umbraco.Web.UI/config/ClientDependency.config
This commit is contained in:
Shannon
2016-03-23 11:04:06 +01:00
19 changed files with 158 additions and 81 deletions

View File

@@ -59,6 +59,25 @@ function listViewController($rootScope, $scope, $routeParams, $injector, $cookie
items: []
};
$scope.currentNodePermissions = {}
//Just ensure we do have an editorState
if (editorState.current) {
//Fetch current node allowed actions for the current user
//This is the current node & not each individual child node in the list
var currentUserPermissions = editorState.current.allowedActions;
//Create a nicer model rather than the funky & hard to remember permissions strings
$scope.currentNodePermissions = {
"canCopy": _.contains(currentUserPermissions, 'O'), //Magic Char = O
"canCreate": _.contains(currentUserPermissions, 'C'), //Magic Char = C
"canDelete": _.contains(currentUserPermissions, 'D'), //Magic Char = D
"canMove": _.contains(currentUserPermissions, 'M'), //Magic Char = M
"canPublish": _.contains(currentUserPermissions, 'U'), //Magic Char = U
"canUnpublish": _.contains(currentUserPermissions, 'U'), //Magic Char = Z (however UI says it can't be set, so if we can publish 'U' we can unpublish)
};
}
//when this is null, we don't check permissions
$scope.buttonPermissions = null;