2022-06-29 19:46:41 -04:00
|
|
|
|
using System.Text.Json.Serialization;
|
2021-10-05 11:12:05 -05:00
|
|
|
|
|
2021-01-12 11:02:39 -05:00
|
|
|
|
namespace Bit.Core.Models.Data;
|
2022-08-29 16:06:55 -04:00
|
|
|
|
|
2021-10-05 11:12:05 -05:00
|
|
|
|
public class Permissions
|
2021-01-12 11:02:39 -05:00
|
|
|
|
{
|
|
|
|
|
|
public bool AccessEventLogs { get; set; }
|
|
|
|
|
|
public bool AccessImportExport { get; set; }
|
|
|
|
|
|
public bool AccessReports { get; set; }
|
2021-10-05 11:12:05 -05:00
|
|
|
|
public bool CreateNewCollections { get; set; }
|
|
|
|
|
|
public bool EditAnyCollection { get; set; }
|
|
|
|
|
|
public bool DeleteAnyCollection { get; set; }
|
2021-01-12 11:02:39 -05:00
|
|
|
|
public bool ManageGroups { get; set; }
|
|
|
|
|
|
public bool ManagePolicies { get; set; }
|
|
|
|
|
|
public bool ManageSso { get; set; }
|
|
|
|
|
|
public bool ManageUsers { get; set; }
|
2021-04-05 09:45:17 -05:00
|
|
|
|
public bool ManageResetPassword { get; set; }
|
2022-07-14 15:58:48 -04:00
|
|
|
|
public bool ManageScim { get; set; }
|
2022-08-29 15:53:48 -04:00
|
|
|
|
|
2021-10-05 11:12:05 -05:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
|
public List<(bool Permission, string ClaimName)> ClaimsMap => new()
|
2022-08-29 15:53:48 -04:00
|
|
|
|
{
|
2021-10-05 11:12:05 -05:00
|
|
|
|
(AccessEventLogs, "accesseventlogs"),
|
|
|
|
|
|
(AccessImportExport, "accessimportexport"),
|
|
|
|
|
|
(AccessReports, "accessreports"),
|
|
|
|
|
|
(CreateNewCollections, "createnewcollections"),
|
|
|
|
|
|
(EditAnyCollection, "editanycollection"),
|
|
|
|
|
|
(DeleteAnyCollection, "deleteanycollection"),
|
|
|
|
|
|
(ManageGroups, "managegroups"),
|
|
|
|
|
|
(ManagePolicies, "managepolicies"),
|
|
|
|
|
|
(ManageSso, "managesso"),
|
|
|
|
|
|
(ManageUsers, "manageusers"),
|
|
|
|
|
|
(ManageResetPassword, "manageresetpassword"),
|
2022-07-14 15:58:48 -04:00
|
|
|
|
(ManageScim, "managescim"),
|
2021-10-05 11:12:05 -05:00
|
|
|
|
};
|
2021-01-12 11:02:39 -05:00
|
|
|
|
}
|