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

@ -23,7 +23,7 @@ namespace Oqtane.Controllers
// GET: api/<controller>
[HttpGet]
[Authorize(Roles = Constants.AdminRole)]
[Authorize(Roles = RoleNames.Admin)]
public IEnumerable<Tenant> Get()
{
return _tenants.GetTenants();
@ -31,7 +31,7 @@ namespace Oqtane.Controllers
// GET api/<controller>/5
[HttpGet("{id}")]
[Authorize(Roles = Constants.AdminRole)]
[Authorize(Roles = RoleNames.Admin)]
public Tenant Get(int id)
{
return _tenants.GetTenant(id);
@ -39,7 +39,7 @@ namespace Oqtane.Controllers
// POST api/<controller>
[HttpPost]
[Authorize(Roles = Constants.HostRole)]
[Authorize(Roles = RoleNames.Host)]
public Tenant Post([FromBody] Tenant tenant)
{
if (ModelState.IsValid)
@ -52,7 +52,7 @@ namespace Oqtane.Controllers
// PUT api/<controller>/5
[HttpPut("{id}")]
[Authorize(Roles = Constants.HostRole)]
[Authorize(Roles = RoleNames.Host)]
public Tenant Put(int id, [FromBody] Tenant tenant)
{
if (ModelState.IsValid)
@ -65,7 +65,7 @@ namespace Oqtane.Controllers
// DELETE api/<controller>/5
[HttpDelete("{id}")]
[Authorize(Roles = Constants.HostRole)]
[Authorize(Roles = RoleNames.Host)]
public void Delete(int id)
{
_tenants.DeleteTenant(id);