diff --git a/src/Admin/Controllers/OrganizationsController.cs b/src/Admin/Controllers/OrganizationsController.cs index f91607dbca..c8d4a0adb7 100644 --- a/src/Admin/Controllers/OrganizationsController.cs +++ b/src/Admin/Controllers/OrganizationsController.cs @@ -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 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 Edit(Guid id, OrganizationEditModel model) { var organization = await _organizationRepository.GetByIdAsync(id); diff --git a/src/Admin/Controllers/UsersController.cs b/src/Admin/Controllers/UsersController.cs index 0833ddc440..79e15a28e0 100644 --- a/src/Admin/Controllers/UsersController.cs +++ b/src/Admin/Controllers/UsersController.cs @@ -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 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 Edit(Guid id, UserEditModel model) { var user = await _userRepository.GetByIdAsync(id); diff --git a/src/Api/Controllers/InstallationsController.cs b/src/Api/Controllers/InstallationsController.cs index 2bd46deef1..6413f04f61 100644 --- a/src/Api/Controllers/InstallationsController.cs +++ b/src/Api/Controllers/InstallationsController.cs @@ -3,9 +3,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Bit.Core.Repositories; using Bit.Core.Models.Api; -using Bit.Api.Utilities; using Microsoft.AspNetCore.Authorization; using Bit.Core.Exceptions; +using Bit.Core.Utilities; namespace Bit.Api.Controllers { diff --git a/src/Api/Controllers/LicensesController.cs b/src/Api/Controllers/LicensesController.cs index a3e6d51ffd..4d254b4c37 100644 --- a/src/Api/Controllers/LicensesController.cs +++ b/src/Api/Controllers/LicensesController.cs @@ -3,11 +3,11 @@ using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; using Bit.Core; using System.Threading.Tasks; -using Bit.Api.Utilities; using Bit.Core.Models.Business; using Bit.Core.Exceptions; using Bit.Core.Repositories; using System; +using Bit.Core.Utilities; namespace Bit.Api.Controllers { diff --git a/src/Api/Controllers/OrganizationsController.cs b/src/Api/Controllers/OrganizationsController.cs index 9995bbb7b1..b4614050b2 100644 --- a/src/Api/Controllers/OrganizationsController.cs +++ b/src/Api/Controllers/OrganizationsController.cs @@ -17,6 +17,7 @@ using jsreport.Types; using Bit.Api.Models; using Stripe; using Microsoft.Extensions.Options; +using Bit.Core.Utilities; namespace Bit.Api.Controllers { diff --git a/src/Api/Controllers/PushController.cs b/src/Api/Controllers/PushController.cs index 5edd4e1c02..7e28593d5c 100644 --- a/src/Api/Controllers/PushController.cs +++ b/src/Api/Controllers/PushController.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using System.Linq; using Microsoft.AspNetCore.Hosting; using Bit.Api.Utilities; +using Bit.Core.Utilities; namespace Bit.Api.Controllers { diff --git a/src/Api/Utilities/SelfHostedAttribute.cs b/src/Core/Utilities/SelfHostedAttribute.cs similarity index 95% rename from src/Api/Utilities/SelfHostedAttribute.cs rename to src/Core/Utilities/SelfHostedAttribute.cs index cc199142ff..254ed71f0f 100644 --- a/src/Api/Utilities/SelfHostedAttribute.cs +++ b/src/Core/Utilities/SelfHostedAttribute.cs @@ -1,9 +1,8 @@ using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; -using Bit.Core; using Bit.Core.Exceptions; -namespace Bit.Api.Utilities +namespace Bit.Core.Utilities { public class SelfHostedAttribute : ActionFilterAttribute {