Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean Dooley 273 posts 490 karma points
    Jan 31, 2017 @ 08:41
    Sean Dooley
    0

    Authorization error: Unauthorized access to URL: /umbraco/backoffice/UmbracoApi/Content/PostSave

    I've created a custom section where I'm displaying content nodes flagged for translation. I am then rendering the edit form which you would see in the Content section.

    I've then added a button to trigger a save event using contentResource.sendToPublish(content, isNew, files) as shown in the code below

    angular.module("umbraco")
    .controller("StagingEditController",
        function ($scope, $routeParams, $http, contentResource, notificationsService) {
            $scope.loaded = false;
    
            $scope.page = {};
    
            if ($routeParams.id === -1) {
                $scope.content = {};
                $scope.loaded = true;
            } else {
                $scope.content = {};
    
                contentResource.getById($routeParams.id)
                    .then(function (response) {
                        $scope.content = response;
                    });
            }
    
            $scope.preview = function(content) {
                console.log('preview', content);
            }
    
            $scope.save = function(content) {
                contentResource.sendToPublish(content, false, [])
                    .then(function(response) {
                        console.log('sendToPublish', response);
    
                        notificationsService.success("Document sent for approval", "");
                    }, function(err) {
                        notificationsService.success(err, "");
                    });
            }
        });
    

    Yet when attempting to save I am getting the following error message

    Authorization error: Unauthorized access to URL: 
    /umbraco/backoffice/UmbracoApi/Content/PostSave
    with data: 
    {"key":"contentItem","value":{"id":1062,"properties":[{"id":142,"alias":"pageTitle","value":"About"},{"id":141,"alias":"metaDescription","value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed posuere urna."},{"id":143,"alias":"umbracoNaviHide","value":"0"},{"id":144,"alias":"hideFromSitemap","value":"0"}],"name":"About","contentTypeAlias":"standardPage","parentId":1055,"action":"sendPublish","expireDate":null,"releaseDate":null,"templateAlias":"StandardPage"}}
    Contact your administrator for information.
    

    Wondering if anyone has come across this issue before and managed to solve it?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies