EntityNames replacements

This commit is contained in:
Pavel Vesely
2020-03-14 18:16:04 +01:00
parent d7b95f5b2c
commit 7feee22b32
12 changed files with 55 additions and 42 deletions

View File

@ -120,7 +120,7 @@ namespace Oqtane.Controllers
[Authorize(Roles = Constants.RegisteredRole)]
public Models.File Put(int id, [FromBody] Models.File File)
{
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, "Folder", File.Folder.FolderId, PermissionNames.Edit))
if (ModelState.IsValid && _userPermissions.IsAuthorized(User, EntityNames.Folder, File.Folder.FolderId, PermissionNames.Edit))
{
File = _files.UpdateFile(File);
_logger.Log(LogLevel.Information, this, LogFunction.Update, "File Updated {File}", File);
@ -140,7 +140,7 @@ namespace Oqtane.Controllers
public void Delete(int id)
{
Models.File file = _files.GetFile(id);
if (_userPermissions.IsAuthorized(User, "Folder", file.Folder.FolderId, PermissionNames.Edit))
if (_userPermissions.IsAuthorized(User, EntityNames.Folder, file.Folder.FolderId, PermissionNames.Edit))
{
_files.DeleteFile(id);