Skip to content

Commit 807d119

Browse files
author
rvdwegen
committed
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP into dev
2 parents 5cd08c1 + 0d484f7 commit 807d119

File tree

22 files changed

+519
-338
lines changed

22 files changed

+519
-338
lines changed

public/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "8.2.1"
2+
"version": "8.3.0"
33
}

src/components/CippComponents/CippExchangeActions.jsx

Lines changed: 123 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import {
33
Archive,
44
MailOutline,
5-
Person,
6-
Room,
75
Visibility,
8-
VisibilityOff,
96
PhonelinkLock,
107
Key,
118
PostAdd,
@@ -17,12 +14,134 @@ import {
1714
MailLock,
1815
SettingsEthernet,
1916
CalendarMonth,
17+
PersonAdd,
2018
Email,
2119
} from "@mui/icons-material";
20+
import { useSettings } from "/src/hooks/use-settings.js";
21+
import { useMemo } from "react";
2222

2323
export const CippExchangeActions = () => {
24-
// const tenant = useSettings().currentTenant;
24+
const tenant = useSettings().currentTenant;
25+
26+
// API configuration for all user selection fields
27+
const userApiConfig = useMemo(() => ({
28+
url: "/api/ListGraphRequest",
29+
dataKey: "Results",
30+
labelField: (option) => `${option.displayName} (${option.userPrincipalName})`,
31+
valueField: "userPrincipalName",
32+
queryKey: `users-${tenant}`,
33+
data: {
34+
Endpoint: "users",
35+
tenantFilter: tenant,
36+
$select: "id,displayName,userPrincipalName,mail",
37+
$top: 999,
38+
},
39+
}), [tenant]);
40+
2541
return [
42+
{
43+
label: "Bulk Add Mailbox Permissions",
44+
type: "POST",
45+
url: "/api/ExecModifyMBPerms",
46+
icon: <PersonAdd />,
47+
data: {
48+
userID: "UPN",
49+
},
50+
confirmText: "Add the specified permissions to selected mailboxes?",
51+
multiPost: false,
52+
data: {
53+
},
54+
fields: [
55+
{
56+
type: "autoComplete",
57+
name: "fullAccessUser",
58+
label: "Add Full Access User",
59+
multiple: true,
60+
creatable: false,
61+
api: userApiConfig,
62+
},
63+
{
64+
type: "switch",
65+
name: "autoMap",
66+
label: "Enable Automapping",
67+
defaultValue: true,
68+
labelLocation: "behind",
69+
},
70+
{
71+
type: "autoComplete",
72+
name: "sendAsUser",
73+
label: "Add Send As User",
74+
multiple: true,
75+
creatable: false,
76+
api: userApiConfig,
77+
},
78+
{
79+
type: "autoComplete",
80+
name: "sendOnBehalfUser",
81+
label: "Add Send On Behalf User",
82+
multiple: true,
83+
creatable: false,
84+
api: userApiConfig,
85+
},
86+
],
87+
customDataformatter: (rows, action, formData) => {
88+
89+
const mailboxArray = Array.isArray(rows) ? rows : [rows];
90+
91+
// Create bulk request array - one object per mailbox
92+
const bulkRequestData = mailboxArray.map(mailbox => {
93+
const permissions = [];
94+
const autoMap = formData.autoMap === undefined ? true : formData.autoMap;
95+
96+
// Add type: "user" to match format
97+
const addTypeToUsers = (users) => {
98+
return users.map(user => ({
99+
...user,
100+
type: "user"
101+
}));
102+
};
103+
104+
// Handle FullAccess - formData.fullAccessUser is an array since multiple: true
105+
if (formData.fullAccessUser && formData.fullAccessUser.length > 0) {
106+
permissions.push({
107+
UserID: addTypeToUsers(formData.fullAccessUser),
108+
PermissionLevel: "FullAccess",
109+
Modification: "Add",
110+
AutoMap: autoMap,
111+
});
112+
}
113+
114+
// Handle SendAs - formData.sendAsUser is an array since multiple: true
115+
if (formData.sendAsUser && formData.sendAsUser.length > 0) {
116+
permissions.push({
117+
UserID: addTypeToUsers(formData.sendAsUser),
118+
PermissionLevel: "SendAs",
119+
Modification: "Add",
120+
});
121+
}
122+
123+
// Handle SendOnBehalf - formData.sendOnBehalfUser is an array since multiple: true
124+
if (formData.sendOnBehalfUser && formData.sendOnBehalfUser.length > 0) {
125+
permissions.push({
126+
UserID: addTypeToUsers(formData.sendOnBehalfUser),
127+
PermissionLevel: "SendOnBehalf",
128+
Modification: "Add",
129+
});
130+
}
131+
132+
return {
133+
userID: mailbox.UPN,
134+
permissions: permissions,
135+
};
136+
});
137+
138+
return {
139+
mailboxRequests: bulkRequestData,
140+
tenantFilter: tenant
141+
};
142+
},
143+
color: "primary",
144+
},
26145
{
27146
label: "Edit permissions",
28147
link: "/identity/administration/users/user/exchange?userId=[ExternalDirectoryObjectId]",
@@ -70,7 +189,6 @@ export const CippExchangeActions = () => {
70189
multiPost: false,
71190
},
72191
{
73-
//tested
74192
label: "Enable Online Archive",
75193
type: "POST",
76194
icon: <Archive />,

src/data/standards.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,6 +3536,33 @@
35363536
"powershellEquivalent": "Update-MgBetaAdminSharePointSetting",
35373537
"recommendedBy": []
35383538
},
3539+
{
3540+
"name": "standards.SPFileRequests",
3541+
"cat": "SharePoint Standards",
3542+
"tag": [],
3543+
"helpText": "Enables or disables File Requests for SharePoint and OneDrive, allowing users to create secure upload-only links. Optionally sets the maximum number of days for the link to remain active before expiring.",
3544+
"docsDescription": "File Requests allow users to create secure upload-only share links where uploads are hidden from other people using the link. This creates a secure and private way for people to upload files to a folder. This feature is not enabled by default on new tenants and requires PowerShell configuration. This standard enables or disables this feature and optionally configures link expiration settings for both SharePoint and OneDrive.",
3545+
"executiveText": "Enables secure file upload functionality that allows external users to submit files directly to company folders without seeing other submissions or folder contents. This provides a professional and secure way to collect documents from clients, vendors, and partners while maintaining data privacy and security.",
3546+
"addedComponent": [
3547+
{
3548+
"type": "switch",
3549+
"name": "standards.SPFileRequests.state",
3550+
"label": "Enable File Requests"
3551+
},
3552+
{
3553+
"type": "number",
3554+
"name": "standards.SPFileRequests.expirationDays",
3555+
"label": "Link Expiration 1-730 Days (Optional)",
3556+
"required": false
3557+
}
3558+
],
3559+
"label": "Set SharePoint and OneDrive File Requests",
3560+
"impact": "Medium Impact",
3561+
"impactColour": "warning",
3562+
"addedDate": "2025-07-30",
3563+
"powershellEquivalent": "Set-SPOTenant -CoreRequestFilesLinkEnabled $true -OneDriveRequestFilesLinkEnabled $true -CoreRequestFilesLinkExpirationInDays 30 -OneDriveRequestFilesLinkExpirationInDays 30",
3564+
"recommendedBy": ["CIPP"]
3565+
},
35393566
{
35403567
"name": "standards.TenantDefaultTimezone",
35413568
"cat": "SharePoint Standards",

src/pages/email/administration/contacts-template/deploy.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const Page = () => {
3131
name="selectedTenants"
3232
type="multiple"
3333
allTenants={true}
34+
preselectedEnabled={true}
3435
validators={{ required: "At least one tenant must be selected" }}
3536
/>
3637
</Grid>

src/pages/email/spamfilter/list-connectionfilter/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/spamfilter/list-quarantine-policies/add.jsx

Lines changed: 61 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const AddPolicy = () => {
4747
name="selectedTenants"
4848
type="multiple"
4949
allTenants={true}
50+
preselectedEnabled={true}
5051
validators={{ required: "At least one tenant must be selected" }}
5152
/>
5253
</Grid>
@@ -72,73 +73,67 @@ const AddPolicy = () => {
7273
</Grid> */}
7374

7475
<Divider sx={{ my: 2, width: "100%" }} />
75-
<Grid xs={6} >
76-
<CippFormComponent
77-
type="textField"
78-
label="Policy Name"
79-
name="Name"
80-
placeholder="Enter policy name"
81-
formControl={formControl}
82-
required={true}
83-
/>
84-
<Divider sx={{ my: 2, width: "100%" }} />
85-
<CippFormComponent
86-
type="autoComplete"
87-
label="Release Action Preference"
88-
name="ReleaseActionPreference"
89-
placeholder="Select release action preference"
90-
formControl={formControl}
91-
required={true}
92-
multiple={false}
93-
options={[
94-
{ label: "Release", value: "Release" },
95-
{ label: "Request Release", value: "RequestRelease" },
96-
]}
97-
/>
98-
</Grid>
76+
<Grid xs={6}>
77+
<CippFormComponent
78+
type="textField"
79+
label="Policy Name"
80+
name="Name"
81+
placeholder="Enter policy name"
82+
formControl={formControl}
83+
required={true}
84+
/>
85+
<Divider sx={{ my: 2, width: "100%" }} />
86+
<CippFormComponent
87+
type="autoComplete"
88+
label="Release Action Preference"
89+
name="ReleaseActionPreference"
90+
placeholder="Select release action preference"
91+
formControl={formControl}
92+
required={true}
93+
multiple={false}
94+
options={[
95+
{ label: "Release", value: "Release" },
96+
{ label: "Request Release", value: "RequestRelease" },
97+
]}
98+
/>
99+
</Grid>
99100

100-
<Grid xs={2}>
101-
102-
<CippFormComponent
103-
type="switch"
104-
label="Delete"
105-
name="Delete"
106-
formControl={formControl}
107-
/>
108-
<CippFormComponent
109-
type="switch"
110-
label="Preview"
111-
name="Preview"
112-
formControl={formControl}
113-
/>
114-
<CippFormComponent
115-
type="switch"
116-
label="Block Sender"
117-
name="BlockSender"
118-
formControl={formControl}
119-
/>
120-
<CippFormComponent
121-
type="switch"
122-
label="Allow Sender"
123-
name="AllowSender"
124-
formControl={formControl}
125-
/>
126-
</Grid>
127-
<Grid xs={4}>
128-
<CippFormComponent
129-
type="switch"
130-
label="Quarantine Notification"
131-
name="QuarantineNotification"
132-
formControl={formControl}
133-
/>
134-
<CippFormComponent
135-
type="switch"
136-
label="Include Messages From Blocked Sender Address"
137-
name="IncludeMessagesFromBlockedSenderAddress"
138-
formControl={formControl}
139-
disabled={!quarantineNotification}
140-
/>
141-
</Grid>
101+
<Grid xs={2}>
102+
<CippFormComponent type="switch" label="Delete" name="Delete" formControl={formControl} />
103+
<CippFormComponent
104+
type="switch"
105+
label="Preview"
106+
name="Preview"
107+
formControl={formControl}
108+
/>
109+
<CippFormComponent
110+
type="switch"
111+
label="Block Sender"
112+
name="BlockSender"
113+
formControl={formControl}
114+
/>
115+
<CippFormComponent
116+
type="switch"
117+
label="Allow Sender"
118+
name="AllowSender"
119+
formControl={formControl}
120+
/>
121+
</Grid>
122+
<Grid xs={4}>
123+
<CippFormComponent
124+
type="switch"
125+
label="Quarantine Notification"
126+
name="QuarantineNotification"
127+
formControl={formControl}
128+
/>
129+
<CippFormComponent
130+
type="switch"
131+
label="Include Messages From Blocked Sender Address"
132+
name="IncludeMessagesFromBlockedSenderAddress"
133+
formControl={formControl}
134+
disabled={!quarantineNotification}
135+
/>
136+
</Grid>
142137
</Grid>
143138
</CippFormPage>
144139
);

src/pages/email/spamfilter/list-spamfilter/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/transport/list-connectors/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/email/transport/list-rules/add.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const AddPolicy = () => {
4141
name="selectedTenants"
4242
type="multiple"
4343
allTenants={true}
44+
preselectedEnabled={true}
4445
validators={{ required: "At least one tenant must be selected" }}
4546
/>
4647
</Grid>

src/pages/endpoint/MEM/add-policy/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Page = () => {
1010
title: "Step 1",
1111
description: "Tenant Selection",
1212
component: CippTenantStep,
13-
componentProps: { type: "multiple", valueField: "customerId" },
13+
componentProps: { type: "multiple" },
1414
},
1515
{
1616
title: "Step 2",

0 commit comments

Comments
 (0)