Example #1
0
        private static bool HasCurrentUserPermissionsToEditCurrentContentNode()
        {
            var result = false;;

            // Get current user
            User user = umbraco.helper.GetCurrentUmbracoUser();

            // Get current content node
            UmbracoHelper umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
            int           nodeId        = Constants.System.Root;

            if (umbracoHelper.AssignedContentItem != null)
            {
                nodeId = umbracoHelper.AssignedContentItem.Id;
            }

            // Check whether there is an user logged in
            if (user != null)
            {
                // Check whether the user has permissions to edit the content node
                result = PermissionHelper.CheckContentPermissions(user.Id, nodeId, new char[] { ActionUpdate.Instance.Letter });
            }
            return(result);
        }