Removing AllowsCultureVariation from ContentController, so we can get rid of OverrideAuthorization attribute

This commit is contained in:
Elitsa Marinovska
2020-12-08 15:36:37 +01:00
parent 474f267e69
commit 54d1e9d5e0
5 changed files with 26 additions and 27 deletions

View File

@@ -42,16 +42,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
return {
allowsCultureVariation: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"contentApiBaseUrl",
"AllowsCultureVariation")),
'Failed to retrieve variant content types');
},
savePermissions: function (saveModel) {
savePermissions: function (saveModel) {
if (!saveModel) {
throw "saveModel cannot be null";
}

View File

@@ -361,6 +361,15 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter, loca
"HasContentNodes",
[{ id: id }])),
'Failed to retrieve indication for whether content type with id ' + id + ' has associated content nodes');
},
allowsCultureVariation: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"contentTypeApiBaseUrl",
"AllowsCultureVariation")),
'Failed to retrieve variant content types');
}
};
}

View File

@@ -9,7 +9,7 @@
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationController($scope, $rootScope, $location, $log, $q, $routeParams, $timeout, $cookies, treeService, appState, navigationService, keyboardService, historyService, eventsService, angularHelper, languageResource, contentResource, editorState) {
function NavigationController($scope, $rootScope, $location, $log, $q, $routeParams, $timeout, $cookies, treeService, appState, navigationService, keyboardService, historyService, eventsService, angularHelper, languageResource, contentTypeResource, editorState) {
//this is used to trigger the tree to start loading once everything is ready
var treeInitPromise = $q.defer();
@@ -380,7 +380,7 @@ function NavigationController($scope, $rootScope, $location, $log, $q, $routePar
*/
function loadLanguages() {
return contentResource.allowsCultureVariation().then(function (b) {
return contentTypeResource.allowsCultureVariation().then(function (b) {
if (b === true) {
return languageResource.getAll();
} else {