add ModuleControllerBase helper method for validating EntityId

This commit is contained in:
Shaun Walker
2022-12-05 14:21:12 -05:00
parent cb10dde97d
commit 28b58b9048
4 changed files with 16 additions and 11 deletions

View File

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http;
using Oqtane.Infrastructure;
using System.Collections.Generic;
using System;
using Oqtane.Shared;
namespace Oqtane.Controllers
{
@ -48,5 +49,9 @@ namespace Oqtane.Controllers
}
}
protected bool IsAuthorizedEntityId(string entityname, int entityid)
{
return (entityid == AuthEntityId(entityname)) || User.IsInRole(RoleNames.Host);
}
}
}