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
+9
-2
@@ -98,7 +98,7 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
]
|
||||
: []),
|
||||
{
|
||||
name: "privacy",
|
||||
name: "privacy_and_security",
|
||||
href: "/settings/organizations/privacy",
|
||||
},
|
||||
|
||||
@@ -170,7 +170,14 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
// The following keys are assigned to admin only
|
||||
const adminRequiredKeys = ["admin"];
|
||||
const organizationRequiredKeys = ["organization"];
|
||||
const organizationAdminKeys = ["privacy", "OAuth Clients", "SSO", "directory_sync", "delegation_credential"];
|
||||
const organizationAdminKeys = [
|
||||
"privacy",
|
||||
"privacy_and_security",
|
||||
"OAuth Clients",
|
||||
"SSO",
|
||||
"directory_sync",
|
||||
"delegation_credential",
|
||||
];
|
||||
|
||||
export interface SettingsPermissions {
|
||||
canViewRoles?: boolean;
|
||||
|
||||
+22
-5
@@ -11,7 +11,7 @@ import { validateUserHasOrg } from "../../actions/validateUserHasOrg";
|
||||
|
||||
export const generateMetadata = async () =>
|
||||
await _generateMetadata(
|
||||
(t) => t("privacy"),
|
||||
(t) => t("privacy_and_security"),
|
||||
(t) => t("privacy_organization_description"),
|
||||
undefined,
|
||||
undefined,
|
||||
@@ -19,9 +19,8 @@ export const generateMetadata = async () =>
|
||||
);
|
||||
|
||||
const Page = async () => {
|
||||
const t = await getTranslate();
|
||||
|
||||
const session = await validateUserHasOrg();
|
||||
const t = await getTranslate();
|
||||
|
||||
if (!session?.user.id || !session?.user.profile?.organizationId || !session?.user.org) {
|
||||
return redirect("/settings/profile");
|
||||
@@ -42,13 +41,31 @@ const Page = async () => {
|
||||
},
|
||||
});
|
||||
|
||||
const watchlistPermissions = await getResourcePermissions({
|
||||
userId: session.user.id,
|
||||
teamId: session.user.profile.organizationId,
|
||||
resource: Resource.Watchlist,
|
||||
userRole: session.user.org.role,
|
||||
fallbackRoles: {
|
||||
read: {
|
||||
roles: [MembershipRole.ADMIN, MembershipRole.OWNER],
|
||||
},
|
||||
create: {
|
||||
roles: [MembershipRole.ADMIN, MembershipRole.OWNER],
|
||||
},
|
||||
delete: {
|
||||
roles: [MembershipRole.ADMIN, MembershipRole.OWNER],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!canRead) {
|
||||
return redirect("/settings/profile");
|
||||
}
|
||||
|
||||
return (
|
||||
<SettingsHeader title={t("privacy")} description={t("privacy_organization_description")}>
|
||||
<PrivacyView permissions={{ canRead, canEdit }} />
|
||||
<SettingsHeader title={t("privacy_and_security")} description={t("privacy_organization_description")}>
|
||||
<PrivacyView permissions={{ canRead, canEdit }} watchlistPermissions={watchlistPermissions} />
|
||||
</SettingsHeader>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user