EntityNames replacements
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user