-
Notifications
You must be signed in to change notification settings - Fork 162
/
Copy pathExample3AppAuthSetupData.cs
58 lines (54 loc) · 2.94 KB
/
Example3AppAuthSetupData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 2021 Jon P Smith, GitHub: JonPSmith, web: http://www.thereformedprogrammer.net/
// Licensed under MIT license. See License.txt in the project root for license information.
using System.Collections.Generic;
using AuthPermissions.BaseCode.DataLayer.Classes.SupportTypes;
using AuthPermissions.BaseCode.SetupCode;
namespace Example3.MvcWebApp.IndividualAccounts.PermissionsCode
{
public static class Example3AppAuthSetupData
{
public static readonly List<BulkLoadRolesDto> RolesDefinition = new()
{
new("SuperAdmin", "Super admin - only use for setup", "AccessAll"),
new("App Admin", "Overall app Admin",
"UserRead, UserSync, UserChange, UserRemove, " +
"UserRolesChange, RoleRead, RoleChange, PermissionRead, IncludeFilteredPermissions, " +
"TenantList, TenantCreate, TenantUpdate, UserChangeTenant, TenantAccessData"),
new("App Support", "overall support - limited admin items",
"UserRead, UserRolesChange, RoleRead, TenantList, TenantAccessData"),
new("Invoice Reader", "Can read invoices", "InvoiceRead"),
new("Invoice Creator", "Can access invoices", "InvoiceCreate"),
//tenant roles
new("Tenant Admin", "Tenant-level admin",
"UserRead, UserRolesChange, RoleRead, InviteUsers", RoleTypes.TenantAdminAdd),
new("Enterprise", "Enterprise features", "InvoiceSum", RoleTypes.TenantAutoAdd)
};
public static readonly List<BulkLoadTenantDto> TenantDefinition = new()
{
new("4U Inc.", "Tenant Admin, Enterprise"), //Enterprise
new("Pets Ltd.", "Tenant Admin"), //Pro
new("Big Rocks Inc."), //Free
};
public static readonly List<BulkLoadUserWithRolesTenant> UsersRolesDefinition = new()
{
new ("[email protected]", null, "SuperAdmin"),
new ("[email protected]", null, "App Admin"),
new("[email protected]", null, "App Support, Invoice Creator"),
new ("[email protected]", null, "Invoice Creator"),
//Company admins.
new ("[email protected]", null,
"Invoice Reader, Invoice Creator, Tenant Admin", tenantNameForDataKey: "4U Inc."),
new("[email protected]", null,
"Invoice Reader, Invoice Creator, Tenant Admin", tenantNameForDataKey: "Pets Ltd."),
//Company users.
new ("[email protected]", null,
"Invoice Reader", tenantNameForDataKey: "4U Inc."),
new ("[email protected]", null,
"Invoice Creator", tenantNameForDataKey: "4U Inc."),
new ("[email protected]", null,
"Invoice Reader, Invoice Creator", tenantNameForDataKey: "Pets Ltd."),
new ("[email protected]", null,
"Invoice Reader, Invoice Creator", tenantNameForDataKey: "Big Rocks Inc."),
};
}
}