feat: blocklist table (#24459)
* feat: blocklist table * feat: blocklist table * refactor: feedback * chore: add select * UI improvements * chore: remove un unsed --------- Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
1 parent
17ab088af8
commit
5a59bb86cd
30 files changed
+2209
-24
No files matched your search
@@ -12,6 +12,7 @@ export enum Resource {
|
||||
Webhook = "webhook",
|
||||
Availability = "availability",
|
||||
OutOfOffice = "ooo",
|
||||
Watchlist = "watchlist",
|
||||
}
|
||||
|
||||
export enum CrudAction {
|
||||
@@ -120,7 +121,7 @@ export const isValidPermissionString = (val: unknown): val is PermissionString =
|
||||
* @returns A new object without the _resource property
|
||||
*/
|
||||
export const filterResourceConfig = (config: ResourceConfig): Omit<ResourceConfig, "_resource"> => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
const { _resource, ...rest } = config;
|
||||
return rest;
|
||||
};
|
||||
@@ -147,7 +148,8 @@ export const getPermissionsForScope = (scope: Scope, isPrivate?: boolean): Permi
|
||||
const scopeMatches = !permissionDetails.scope || permissionDetails.scope.includes(scope);
|
||||
|
||||
// Check privacy visibility (only if isPrivate is provided)
|
||||
const privacyMatches = teamPrivacy === undefined ||
|
||||
const privacyMatches =
|
||||
teamPrivacy === undefined ||
|
||||
!permissionDetails.visibleWhen?.teamPrivacy ||
|
||||
permissionDetails.visibleWhen.teamPrivacy === "both" ||
|
||||
permissionDetails.visibleWhen.teamPrivacy === teamPrivacy;
|
||||
@@ -672,4 +674,40 @@ export const PERMISSION_REGISTRY: PermissionRegistry = {
|
||||
dependsOn: ["ooo.read"],
|
||||
},
|
||||
},
|
||||
[Resource.Watchlist]: {
|
||||
_resource: {
|
||||
i18nKey: "pbac_resource_blocklist",
|
||||
},
|
||||
[CrudAction.Create]: {
|
||||
description: "Create watchlist entries",
|
||||
category: "watchlist",
|
||||
i18nKey: "pbac_action_create",
|
||||
descriptionI18nKey: "pbac_desc_create_watchlist_entries",
|
||||
scope: [Scope.Organization],
|
||||
dependsOn: ["watchlist.read"],
|
||||
},
|
||||
[CrudAction.Read]: {
|
||||
description: "View watchlist entries",
|
||||
category: "watchlist",
|
||||
i18nKey: "pbac_action_read",
|
||||
descriptionI18nKey: "pbac_desc_view_watchlist_entries",
|
||||
scope: [Scope.Organization],
|
||||
},
|
||||
[CrudAction.Update]: {
|
||||
description: "Update watchlist entries",
|
||||
category: "watchlist",
|
||||
i18nKey: "pbac_action_update",
|
||||
descriptionI18nKey: "pbac_desc_update_watchlist_entries",
|
||||
scope: [Scope.Organization],
|
||||
dependsOn: ["watchlist.read"],
|
||||
},
|
||||
[CrudAction.Delete]: {
|
||||
description: "Delete watchlist entries",
|
||||
category: "watchlist",
|
||||
i18nKey: "pbac_action_delete",
|
||||
descriptionI18nKey: "pbac_desc_delete_watchlist_entries",
|
||||
scope: [Scope.Organization],
|
||||
dependsOn: ["watchlist.read"],
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user