Factored out Contants.*** Role into RoleNames.***

Renamed 'AllUsers' to 'Everyone'
This commit is contained in:
Tony Valenti
2020-10-16 06:22:52 -05:00
parent 81475fd835
commit 955e7a3856
47 changed files with 298 additions and 285 deletions

View File

@ -28,7 +28,7 @@ namespace Oqtane.Controllers
// GET: api/<controller>
[HttpGet]
[Authorize(Roles = Constants.HostRole)]
[Authorize(Roles = RoleNames.Host)]
public IEnumerable<Site> Get()
{
return _sites.GetSites();
@ -57,7 +57,7 @@ namespace Oqtane.Controllers
}
else
{
authorized = User.IsInRole(Constants.HostRole);
authorized = User.IsInRole(RoleNames.Host);
}
if (authorized)
{
@ -70,7 +70,7 @@ namespace Oqtane.Controllers
// PUT api/<controller>/5
[HttpPut("{id}")]
[Authorize(Roles = Constants.AdminRole)]
[Authorize(Roles = RoleNames.Admin)]
public Site Put(int id, [FromBody] Site site)
{
if (ModelState.IsValid)
@ -84,7 +84,7 @@ namespace Oqtane.Controllers
// DELETE api/<controller>/5
[HttpDelete("{id}")]
[Authorize(Roles = Constants.HostRole)]
[Authorize(Roles = RoleNames.Host)]
public void Delete(int id)
{
_sites.DeleteSite(id);