Skip to content

Commit

Permalink
Added new Role & Permissions System
Browse files Browse the repository at this point in the history
  • Loading branch information
mesquidar committed Nov 5, 2024
1 parent e1faa84 commit 6316593
Show file tree
Hide file tree
Showing 244 changed files with 6,071 additions and 3,189 deletions.
44 changes: 44 additions & 0 deletions Cervantes.CORE/AppAuthSetupData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using AuthPermissions.BaseCode.SetupCode;

namespace Cervantes.CORE;

public static class AppAuthSetupData
{
public static readonly List<BulkLoadRolesDto> RolesDefinition = new()
{
new("User", "Default User Role", "ClientsRead,ProjectsRead,ProjectMembersRead,ProjectNotesRead," +
"ProjectNotesEdit,ProjectNotesAdd,ProjectNotesDelete," +
"ProjectAttachmentsRead,ProjectAttachmentsAdd,ProjectAttachmentsDelete," +
"ProjectExecutiveSummaryRead,ProjectExecutiveSummaryEdit," +
"DocumentsRead,TasksRead,TasksEdit,TasksAdd,TasksDelete," +
"VulnsRead,VulnsEdit,VulnsAdd,VulnsDelete,VulnsImport,VulnCategoriesRead," +
"VulnAttachmentsRead,VulnAttachmentsAdd,VulnAttachmentsDelete,VulnAttachmentsDownload,VulnNotesRead,VulnNotesEdit,VulnNotesAdd,VulnNotesDelete," +
"KnowledgeBaseRead,KnowledgeBaseEdit,KnowledgeBaseAdd,KnowledgeBaseDelete," +
"ReportsRead,CalendarRead,WorkspacesRead,TargetsRead,TargetsEdit,TargetsAdd,TargetsDelete," +
"TargetsServicesRead,TargetsServicesEdit,TargetsServicesAdd,TargetsServicesDelete," +
"NotesRead,NotesEdit,NotesAdd,NotesDelete,TaskNotesRead,TaskNotesEdit,TaskNotesAdd,TaskNotesDelete," +
"TaskAttachmentsRead,TaskAttachmentsAdd,TaskAttachmentsDelete,TaskAttachmentsDownload," +
"TaskTargetsRead,TaskTargetsEdit,TaskTargetsAdd,TaskTargetsDelete," +
"VulnTargetsRead,VulnTargetsEdit,VulnTargetsAdd,VulnTargetsDelete," +
"JiraRead,JiraEdit,JiraAdd,JiraDelete,JiraCommentsRead,JiraCommentsAdd," +
"VaultRead,VaultEdit,VaultAdd,VaultDelete,ChecklistsRead,ChecklistsEdit,ChecklistsAdd,ChecklistsDelete,AIServiceUsage"),
new("Manager", "Manager Role (Manage Projects, Reports, Tasks, etc.)", "ClientsRead,ClientsEdit,ClientsAdd,ClientsDelete," +
"ProjectsRead,ProjectsEdit,ProjectsAdd,ProjectsDelete,ProjectMembersRead,ProjectMembersAdd,ProjectMembersDelete," +
"ProjectNotesRead,ProjectNotesEdit,ProjectNotesAdd,ProjectNotesDelete,ProjectAttachmentsRead,ProjectAttachmentsAdd,ProjectAttachmentsDelete,ProjectAttachmentsDownload," +
"ProjectExecutiveSummaryRead,ProjectExecutiveSummaryEdit,DocumentsRead,DocumentsEdit,DocumentsAdd,DocumentsDelete,TasksRead,TasksEdit,TasksAdd,TasksDelete," +
"VulnsRead,VulnsEdit,VulnsAdd,VulnsDelete,VulnsImport,VulnCategoriesRead,VulnCategoriesEdit,VulnCategoriesAdd,VulnCategoriesDelete," +
"VulnAttachmentsRead,VulnAttachmentsAdd,VulnAttachmentsDelete,VulnAttachmentsDownload,VulnNotesRead,VulnNotesEdit,VulnNotesAdd,VulnNotesDelete,"+
"KnowledgeBaseRead,KnowledgeBaseEdit,KnowledgeBaseAdd,KnowledgeBaseDelete,KnowledgeBaseCategoryRead,KnowledgeBaseCategoryEdit,KnowledgeBaseCategoryDelete,KnowledgeBaseCategoryAdd,OrganizationRead,OrganizationEdit," +
"ReportTemplatesRead,ReportTemplatesEdit,ReportTemplatesAdd,ReportTemplatesDelete,ReportComponentsRead,ReportComponentsEdit,ReportComponentsAdd,ReportComponentsDelete," +
"ReportsRead,ReportsEdit,ReportsAdd,ReportsDelete,CalendarRead,WorkspacesRead," +
"TargetsRead,TargetsEdit,TargetsAdd,TargetsDelete,TargetsServicesRead,TargetsServicesEdit,TargetsServicesAdd,TargetsServicesDelete,NotesRead,NotesEdit,NotesAdd,NotesDelete," +
"TaskNotesRead,TaskNotesEdit,TaskNotesAdd,TaskNotesDelete,TaskAttachmentsRead,TaskAttachmentsAdd,TaskAttachmentsDelete,TaskAttachmentsDownload,TaskTargetsRead,TaskTargetsEdit,TaskTargetsAdd,TaskTargetsDelete," +
"VulnTargetsRead,VulnTargetsEdit,VulnTargetsAdd,VulnTargetsDelete,JiraRead,JiraEdit,JiraAdd,JiraDelete,JiraCommentsRead,JiraCommentsAdd,VaultRead,VaultEdit,VaultAdd,VaultDelete,ChecklistsRead,ChecklistsEdit,ChecklistsAdd,ChecklistsDelete,AIServiceUsage"),
new("Admin", "This allows the user to access every feature", "Admin"),
};

public static readonly List<BulkLoadUserWithRolesTenant> UsersWithRolesDefinition = new()
{
new ( "admin@cervantes.local", null, "Admin"),
};
}
1 change: 1 addition & 0 deletions Cervantes.CORE/Cervantes.CORE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AuthPermissions.AspNetCore" Version="8.0.0" />
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Forms" Version="8.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.8" />
Expand Down
Loading

0 comments on commit 6316593

Please sign in to comment.