Dissallow users to save languages they do not have access to

This commit is contained in:
Nikolaj Geisle
2022-05-10 14:57:58 +02:00
parent 23bb172be0
commit eda9328f99
5 changed files with 73 additions and 4 deletions

View File

@@ -796,6 +796,13 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
// we will continue to save if model state is invalid, however we cannot save if critical data is missing.
if (!ModelState.IsValid)
{
// Don't try and save if we do not have access
if (ModelState.Keys.Contains(Constants.ModelStateErrorKeys.PermissionError))
{
var forDisplay = mapToDisplay(contentItem.PersistedContent);
return ValidationProblem(forDisplay, ModelState);
}
// check for critical data validation issues, we can't continue saving if this data is invalid
if (!passesCriticalValidationRules)
{