1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

limit edit functions to cloud hosted

This commit is contained in:
Kyle Spearrin
2018-03-23 09:44:48 -04:00
parent bd3457fc06
commit 2cf9127ef1
7 changed files with 11 additions and 4 deletions

View File

@ -7,6 +7,7 @@ using Bit.Admin.Models;
using System.Collections.Generic;
using Bit.Core.Models.Table;
using Bit.Core;
using Bit.Core.Utilities;
namespace Bit.Admin.Controllers
{
@ -65,6 +66,7 @@ namespace Bit.Admin.Controllers
return View(new OrganizationViewModel(organization, users));
}
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<IActionResult> Edit(Guid id)
{
var organization = await _organizationRepository.GetByIdAsync(id);
@ -79,6 +81,7 @@ namespace Bit.Admin.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<IActionResult> Edit(Guid id, OrganizationEditModel model)
{
var organization = await _organizationRepository.GetByIdAsync(id);

View File

@ -7,6 +7,7 @@ using Bit.Admin.Models;
using System.Collections.Generic;
using Bit.Core.Models.Table;
using Bit.Core;
using Bit.Core.Utilities;
namespace Bit.Admin.Controllers
{
@ -62,6 +63,7 @@ namespace Bit.Admin.Controllers
return View(new UserViewModel(user, ciphers));
}
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<IActionResult> Edit(Guid id)
{
var user = await _userRepository.GetByIdAsync(id);
@ -76,6 +78,7 @@ namespace Bit.Admin.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
[SelfHosted(NotSelfHostedOnly = true)]
public async Task<IActionResult> Edit(Guid id, UserEditModel model)
{
var user = await _userRepository.GetByIdAsync(id);