mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00
PM-12995 device exception cache permissions update (#5277)
* feat(newDeviceVerification) : - adding more granular permissions for the login exception button. - fixed access to the button for different permissions
This commit is contained in:
parent
5201085ecb
commit
a015f429c2
@ -165,7 +165,7 @@ public class UsersController : Controller
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
[RequirePermission(Permission.User_GeneralDetails_View)]
|
[RequirePermission(Permission.User_NewDeviceException_Edit)]
|
||||||
[RequireFeature(FeatureFlagKeys.NewDeviceVerification)]
|
[RequireFeature(FeatureFlagKeys.NewDeviceVerification)]
|
||||||
public async Task<IActionResult> ToggleNewDeviceVerification(Guid id)
|
public async Task<IActionResult> ToggleNewDeviceVerification(Guid id)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,7 @@ public enum Permission
|
|||||||
User_Billing_View,
|
User_Billing_View,
|
||||||
User_Billing_Edit,
|
User_Billing_Edit,
|
||||||
User_Billing_LaunchGateway,
|
User_Billing_LaunchGateway,
|
||||||
|
User_NewDeviceException_Edit,
|
||||||
|
|
||||||
Org_List_View,
|
Org_List_View,
|
||||||
Org_OrgInformation_View,
|
Org_OrgInformation_View,
|
||||||
|
@ -12,7 +12,6 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_List_View,
|
Permission.User_List_View,
|
||||||
Permission.User_UserInformation_View,
|
Permission.User_UserInformation_View,
|
||||||
Permission.User_GeneralDetails_View,
|
Permission.User_GeneralDetails_View,
|
||||||
Permission.Org_CheckEnabledBox,
|
|
||||||
Permission.User_Delete,
|
Permission.User_Delete,
|
||||||
Permission.User_UpgradePremium,
|
Permission.User_UpgradePremium,
|
||||||
Permission.User_BillingInformation_View,
|
Permission.User_BillingInformation_View,
|
||||||
@ -24,6 +23,8 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_Billing_View,
|
Permission.User_Billing_View,
|
||||||
Permission.User_Billing_Edit,
|
Permission.User_Billing_Edit,
|
||||||
Permission.User_Billing_LaunchGateway,
|
Permission.User_Billing_LaunchGateway,
|
||||||
|
Permission.User_NewDeviceException_Edit,
|
||||||
|
Permission.Org_CheckEnabledBox,
|
||||||
Permission.Org_List_View,
|
Permission.Org_List_View,
|
||||||
Permission.Org_OrgInformation_View,
|
Permission.Org_OrgInformation_View,
|
||||||
Permission.Org_GeneralDetails_View,
|
Permission.Org_GeneralDetails_View,
|
||||||
@ -57,7 +58,6 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_List_View,
|
Permission.User_List_View,
|
||||||
Permission.User_UserInformation_View,
|
Permission.User_UserInformation_View,
|
||||||
Permission.User_GeneralDetails_View,
|
Permission.User_GeneralDetails_View,
|
||||||
Permission.Org_CheckEnabledBox,
|
|
||||||
Permission.User_Delete,
|
Permission.User_Delete,
|
||||||
Permission.User_UpgradePremium,
|
Permission.User_UpgradePremium,
|
||||||
Permission.User_BillingInformation_View,
|
Permission.User_BillingInformation_View,
|
||||||
@ -70,6 +70,8 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_Billing_View,
|
Permission.User_Billing_View,
|
||||||
Permission.User_Billing_Edit,
|
Permission.User_Billing_Edit,
|
||||||
Permission.User_Billing_LaunchGateway,
|
Permission.User_Billing_LaunchGateway,
|
||||||
|
Permission.User_NewDeviceException_Edit,
|
||||||
|
Permission.Org_CheckEnabledBox,
|
||||||
Permission.Org_List_View,
|
Permission.Org_List_View,
|
||||||
Permission.Org_OrgInformation_View,
|
Permission.Org_OrgInformation_View,
|
||||||
Permission.Org_GeneralDetails_View,
|
Permission.Org_GeneralDetails_View,
|
||||||
@ -106,7 +108,6 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_List_View,
|
Permission.User_List_View,
|
||||||
Permission.User_UserInformation_View,
|
Permission.User_UserInformation_View,
|
||||||
Permission.User_GeneralDetails_View,
|
Permission.User_GeneralDetails_View,
|
||||||
Permission.Org_CheckEnabledBox,
|
|
||||||
Permission.User_UpgradePremium,
|
Permission.User_UpgradePremium,
|
||||||
Permission.User_BillingInformation_View,
|
Permission.User_BillingInformation_View,
|
||||||
Permission.User_BillingInformation_DownloadInvoice,
|
Permission.User_BillingInformation_DownloadInvoice,
|
||||||
@ -114,6 +115,8 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_Licensing_View,
|
Permission.User_Licensing_View,
|
||||||
Permission.User_Billing_View,
|
Permission.User_Billing_View,
|
||||||
Permission.User_Billing_LaunchGateway,
|
Permission.User_Billing_LaunchGateway,
|
||||||
|
Permission.User_NewDeviceException_Edit,
|
||||||
|
Permission.Org_CheckEnabledBox,
|
||||||
Permission.Org_List_View,
|
Permission.Org_List_View,
|
||||||
Permission.Org_OrgInformation_View,
|
Permission.Org_OrgInformation_View,
|
||||||
Permission.Org_GeneralDetails_View,
|
Permission.Org_GeneralDetails_View,
|
||||||
@ -135,7 +138,6 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_List_View,
|
Permission.User_List_View,
|
||||||
Permission.User_UserInformation_View,
|
Permission.User_UserInformation_View,
|
||||||
Permission.User_GeneralDetails_View,
|
Permission.User_GeneralDetails_View,
|
||||||
Permission.Org_CheckEnabledBox,
|
|
||||||
Permission.User_UpgradePremium,
|
Permission.User_UpgradePremium,
|
||||||
Permission.User_BillingInformation_View,
|
Permission.User_BillingInformation_View,
|
||||||
Permission.User_BillingInformation_DownloadInvoice,
|
Permission.User_BillingInformation_DownloadInvoice,
|
||||||
@ -146,6 +148,7 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_Billing_View,
|
Permission.User_Billing_View,
|
||||||
Permission.User_Billing_Edit,
|
Permission.User_Billing_Edit,
|
||||||
Permission.User_Billing_LaunchGateway,
|
Permission.User_Billing_LaunchGateway,
|
||||||
|
Permission.Org_CheckEnabledBox,
|
||||||
Permission.Org_List_View,
|
Permission.Org_List_View,
|
||||||
Permission.Org_OrgInformation_View,
|
Permission.Org_OrgInformation_View,
|
||||||
Permission.Org_GeneralDetails_View,
|
Permission.Org_GeneralDetails_View,
|
||||||
@ -177,12 +180,12 @@ public static class RolePermissionMapping
|
|||||||
Permission.User_List_View,
|
Permission.User_List_View,
|
||||||
Permission.User_UserInformation_View,
|
Permission.User_UserInformation_View,
|
||||||
Permission.User_GeneralDetails_View,
|
Permission.User_GeneralDetails_View,
|
||||||
Permission.Org_CheckEnabledBox,
|
|
||||||
Permission.User_BillingInformation_View,
|
Permission.User_BillingInformation_View,
|
||||||
Permission.User_BillingInformation_DownloadInvoice,
|
Permission.User_BillingInformation_DownloadInvoice,
|
||||||
Permission.User_Premium_View,
|
Permission.User_Premium_View,
|
||||||
Permission.User_Licensing_View,
|
Permission.User_Licensing_View,
|
||||||
Permission.User_Licensing_Edit,
|
Permission.User_Licensing_Edit,
|
||||||
|
Permission.Org_CheckEnabledBox,
|
||||||
Permission.Org_List_View,
|
Permission.Org_List_View,
|
||||||
Permission.Org_OrgInformation_View,
|
Permission.Org_OrgInformation_View,
|
||||||
Permission.Org_GeneralDetails_View,
|
Permission.Org_GeneralDetails_View,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
ViewData["Title"] = "User: " + Model.User.Email;
|
ViewData["Title"] = "User: " + Model.User.Email;
|
||||||
|
|
||||||
var canViewUserInformation = AccessControlService.UserHasPermission(Permission.User_UserInformation_View);
|
var canViewUserInformation = AccessControlService.UserHasPermission(Permission.User_UserInformation_View);
|
||||||
var canViewNewDeviceException = AccessControlService.UserHasPermission(Permission.User_UserInformation_View) &&
|
var canViewNewDeviceException = AccessControlService.UserHasPermission(Permission.User_NewDeviceException_Edit) &&
|
||||||
FeatureService.IsEnabled(Bit.Core.FeatureFlagKeys.NewDeviceVerification);
|
FeatureService.IsEnabled(Bit.Core.FeatureFlagKeys.NewDeviceVerification);
|
||||||
var canViewBillingInformation = AccessControlService.UserHasPermission(Permission.User_BillingInformation_View);
|
var canViewBillingInformation = AccessControlService.UserHasPermission(Permission.User_BillingInformation_View);
|
||||||
var canViewGeneral = AccessControlService.UserHasPermission(Permission.User_GeneralDetails_View);
|
var canViewGeneral = AccessControlService.UserHasPermission(Permission.User_GeneralDetails_View);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user