@antonytm/mcp-sitecore-server 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/tools/powershell/composite/register-composite-powershell.d.ts +3 -0
- package/dist/tools/powershell/composite/register-composite-powershell.js +5 -0
- package/dist/tools/powershell/composite/register-composite-powershell.js.map +1 -0
- package/dist/tools/powershell/composite/security/register-security-powershell.d.ts +3 -0
- package/dist/tools/powershell/composite/security/register-security-powershell.js +5 -0
- package/dist/tools/powershell/composite/security/register-security-powershell.js.map +1 -0
- package/dist/tools/powershell/composite/security/register-set-item-acl.d.ts +3 -0
- package/dist/tools/powershell/composite/security/register-set-item-acl.js +59 -0
- package/dist/tools/powershell/composite/security/register-set-item-acl.js.map +1 -0
- package/dist/tools/powershell/register-powershell.js +2 -0
- package/dist/tools/powershell/register-powershell.js.map +1 -1
- package/dist/tools/powershell/simple/security/access-rights.d.ts +7 -0
- package/dist/tools/powershell/simple/security/access-rights.js +33 -0
- package/dist/tools/powershell/simple/security/access-rights.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-add-item-acl.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-add-item-acl.js +66 -0
- package/dist/tools/powershell/simple/security/register-add-item-acl.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-clear-item-acl.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-clear-item-acl.js +46 -0
- package/dist/tools/powershell/simple/security/register-clear-item-acl.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-get-item-acl.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-get-item-acl.js +56 -0
- package/dist/tools/powershell/simple/security/register-get-item-acl.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-security-powershell.js +12 -0
- package/dist/tools/powershell/simple/security/register-security-powershell.js.map +1 -1
- package/dist/tools/powershell/simple/security/register-set-user-password.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-set-user-password.js +29 -0
- package/dist/tools/powershell/simple/security/register-set-user-password.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-set-user.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-set-user.js +66 -0
- package/dist/tools/powershell/simple/security/register-set-user.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-test-item-acl.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-test-item-acl.js +59 -0
- package/dist/tools/powershell/simple/security/register-test-item-acl.js.map +1 -0
- package/dist/tools/powershell/utils.d.ts +1 -0
- package/dist/tools/powershell/utils.js +18 -0
- package/dist/tools/powershell/utils.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
- [x] `security-get-role-member`: returns members of a role
|
|
41
41
|
- [x] `security-enable-user`: enables a user
|
|
42
42
|
- [x] `security-disable-user`: disables a user
|
|
43
|
+
- [x] `security-set-user-password`: changes a user's password
|
|
43
44
|
- [x] `security-lock-item-by-id`: locks an item by ID
|
|
44
45
|
- [x] `security-unlock-item-by-id`: unlocks an item by ID
|
|
45
46
|
- [x] `security-lock-item-by-path`: locks an item by path
|
|
@@ -59,6 +60,14 @@
|
|
|
59
60
|
- [ ] `security-import-role`: imports a role. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1372)
|
|
60
61
|
- [x] `security-add-role-member`: adds a member to a role
|
|
61
62
|
- [x] `security-remove-role-member`: removes a member from a role
|
|
63
|
+
- [x] `security-test-item-acl-by-id`: tests an item ACL by ID
|
|
64
|
+
- [x] `security-test-item-acl-by-path`: tests an item ACL by path
|
|
65
|
+
- [x] `security-add-item-acl-by-id`: adds an item ACL by ID
|
|
66
|
+
- [x] `security-add-item-acl-by-path`: adds an item ACL by path
|
|
67
|
+
- [x] `security-clear-item-acl-by-id`: clears an item ACL by ID
|
|
68
|
+
- [x] `security-clear-item-acl-by-path`: clears an item ACL by path
|
|
69
|
+
- [x] `security-set-item-acl-by-id`: sets an item ACL by ID
|
|
70
|
+
- [x] `security-set-item-acl-by-path`: sets an item ACL by path
|
|
62
71
|
|
|
63
72
|
- [ ] Sitecore CLI
|
|
64
73
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-composite-powershell.js","sourceRoot":"","sources":["../../../../src/tools/powershell/composite/register-composite-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAc;IACzE,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { prepareArgsString } from "../../utils.js";
|
|
4
|
+
import { AccessRights } from "../../simple/security/access-rights.js";
|
|
5
|
+
import { runGenericPowershellCommand } from "../../simple/generic.js";
|
|
6
|
+
// This security tool doesn't have sense as it could be replaced with Add-ItemAcl+Clear-ItemAcl tools.
|
|
7
|
+
// It is kept for testing "composite" tools.
|
|
8
|
+
export function registerSetItemAclPowerShell(server, config) {
|
|
9
|
+
server.tool("security-set-item-acl-by-id", "Sets an access control entry to a Sitecore item by its ID.", {
|
|
10
|
+
id: z.string()
|
|
11
|
+
.describe("The ID of the item to add ACL entry for"),
|
|
12
|
+
identity: z.string()
|
|
13
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
14
|
+
accessRight: z.enum(AccessRights)
|
|
15
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
16
|
+
propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
|
|
17
|
+
.describe("The propagation type for the access right"),
|
|
18
|
+
securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
19
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
20
|
+
}, async (params) => {
|
|
21
|
+
const parameters1Obj = {};
|
|
22
|
+
parameters1Obj["Identity"] = params.identity;
|
|
23
|
+
parameters1Obj["AccessRight"] = params.accessRight;
|
|
24
|
+
parameters1Obj["PropagationType"] = params.propagationType;
|
|
25
|
+
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
26
|
+
const parameters1 = prepareArgsString(parameters1Obj);
|
|
27
|
+
const command = `
|
|
28
|
+
$acl = New-ItemAcl ${parameters1}
|
|
29
|
+
Get-Item -Id ${params.id} | Set-ItemAcl -AccessRules $acl
|
|
30
|
+
`.replaceAll(/[\n]+/g, "");
|
|
31
|
+
;
|
|
32
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
33
|
+
});
|
|
34
|
+
server.tool("security-set-item-acl-by-path", "Sets an access control entry to a Sitecore item by its path.", {
|
|
35
|
+
path: z.string()
|
|
36
|
+
.describe("The path of the item to add ACL entry for"),
|
|
37
|
+
identity: z.string()
|
|
38
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
39
|
+
accessRight: z.enum(AccessRights)
|
|
40
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
41
|
+
propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
|
|
42
|
+
.describe("The propagation type for the access right"),
|
|
43
|
+
securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
44
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
45
|
+
}, async (params) => {
|
|
46
|
+
const parameters1Obj = {};
|
|
47
|
+
parameters1Obj["Identity"] = params.identity;
|
|
48
|
+
parameters1Obj["AccessRight"] = params.accessRight;
|
|
49
|
+
parameters1Obj["PropagationType"] = params.propagationType;
|
|
50
|
+
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
51
|
+
const parameters1 = prepareArgsString(parameters1Obj);
|
|
52
|
+
const command = `
|
|
53
|
+
$acl = New-ItemAcl ${parameters1}
|
|
54
|
+
Get-Item -Path "${params.path}" | Set-ItemAcl -AccessRules $acl
|
|
55
|
+
`.replaceAll(/[\n]+/g, "");
|
|
56
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=register-set-item-acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-set-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/security/register-set-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,sGAAsG;AACtG,4CAA4C;AAC5C,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,4DAA4D,EAC5D;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,yCAAyC,CAAC;QACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,6FAA6F,CAAC;QAC5G,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,YAAqC,CAAC;aACr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;aACrD,QAAQ,CAAC,4DAA4D,CAAC;QAC3E,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;aAC3E,QAAQ,CAAC,2CAA2C,CAAC;QAC1D,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;aAC3E,QAAQ,CAAC,qDAAqD,CAAC;KACvE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,cAAc,GAAQ,EAAE,CAAC;QAC/B,cAAc,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC7C,cAAc,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QACnD,cAAc,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC;QAC3D,cAAc,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEjE,MAAM,WAAW,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG;qCACS,WAAW;kCACd,MAAM,CAAC,IAAI;aAChC,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE3B,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { registerSimplePowerShell } from "./simple/register-simple-powershell.js";
|
|
2
|
+
import { registerCompositePowerShell } from "./composite/register-composite-powershell.js";
|
|
2
3
|
export function registerPowerShell(server, config) {
|
|
3
4
|
registerSimplePowerShell(server, config);
|
|
5
|
+
registerCompositePowerShell(server, config);
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=register-powershell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-powershell.js","sourceRoot":"","sources":["../../../src/tools/powershell/register-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"register-powershell.js","sourceRoot":"","sources":["../../../src/tools/powershell/register-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAc;IAChE,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple array of access rights available in Sitecore security operations.
|
|
3
|
+
* Used in security-related PowerShell operations like Test-ItemAcl.
|
|
4
|
+
*
|
|
5
|
+
* @see https://doc.sitecorepowershell.com/appendix/security/test-itemacl
|
|
6
|
+
*/
|
|
7
|
+
export declare const AccessRights: string[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple array of access rights available in Sitecore security operations.
|
|
3
|
+
* Used in security-related PowerShell operations like Test-ItemAcl.
|
|
4
|
+
*
|
|
5
|
+
* @see https://doc.sitecorepowershell.com/appendix/security/test-itemacl
|
|
6
|
+
*/
|
|
7
|
+
export const AccessRights = [
|
|
8
|
+
// Item-level access rights
|
|
9
|
+
'item:read',
|
|
10
|
+
'item:write',
|
|
11
|
+
'item:create',
|
|
12
|
+
'item:delete',
|
|
13
|
+
'item:rename',
|
|
14
|
+
'item:admin',
|
|
15
|
+
// Field-level access rights
|
|
16
|
+
'field:read',
|
|
17
|
+
'field:write',
|
|
18
|
+
// Language-level access rights
|
|
19
|
+
'language:read',
|
|
20
|
+
'language:write',
|
|
21
|
+
// Workflow-related access rights
|
|
22
|
+
'workflowState:delete',
|
|
23
|
+
'workflowState:write',
|
|
24
|
+
'workflowCommand:execute',
|
|
25
|
+
// Additional access rights
|
|
26
|
+
'site:enter',
|
|
27
|
+
'remote:fieldread',
|
|
28
|
+
'insert:show',
|
|
29
|
+
'profile:customize',
|
|
30
|
+
'bucket:makebucket',
|
|
31
|
+
'bucket:unmake'
|
|
32
|
+
];
|
|
33
|
+
//# sourceMappingURL=access-rights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-rights.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/access-rights.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,2BAA2B;IAC3B,WAAW;IACX,YAAY;IACZ,aAAa;IACb,aAAa;IACb,aAAa;IACb,YAAY;IAEZ,4BAA4B;IAC5B,YAAY;IACZ,aAAa;IAEb,+BAA+B;IAC/B,eAAe;IACf,gBAAgB;IAEhB,iCAAiC;IACjC,sBAAsB;IACtB,qBAAqB;IACrB,yBAAyB;IAEzB,2BAA2B;IAC3B,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;CAChB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
import { AccessRights } from "./access-rights.js";
|
|
5
|
+
export function registerAddItemAclPowerShell(server, config) {
|
|
6
|
+
server.tool("security-add-item-acl-by-id", "Adds an access control entry to a Sitecore item by its ID.", {
|
|
7
|
+
id: z.string()
|
|
8
|
+
.describe("The ID of the item to add ACL entry for"),
|
|
9
|
+
identity: z.string()
|
|
10
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
11
|
+
accessRight: z.enum(AccessRights)
|
|
12
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
13
|
+
propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
|
|
14
|
+
.describe("The propagation type for the access right"),
|
|
15
|
+
securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
16
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
17
|
+
database: z.string().optional()
|
|
18
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
19
|
+
}, async (params) => {
|
|
20
|
+
const command = `Add-ItemAcl`;
|
|
21
|
+
const options = {
|
|
22
|
+
"ID": params.id,
|
|
23
|
+
"Identity": params.identity,
|
|
24
|
+
"AccessRight": params.accessRight,
|
|
25
|
+
"PropagationType": params.propagationType,
|
|
26
|
+
"SecurityPermission": params.securityPermission
|
|
27
|
+
};
|
|
28
|
+
if (params.database) {
|
|
29
|
+
options["Database"] = params.database;
|
|
30
|
+
}
|
|
31
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
32
|
+
});
|
|
33
|
+
server.tool("security-add-item-acl-by-path", "Adds an access control entry to a Sitecore item by its path.", {
|
|
34
|
+
path: z.string()
|
|
35
|
+
.describe("The path of the item to add ACL entry for (e.g. /sitecore/content/Home)"),
|
|
36
|
+
identity: z.string()
|
|
37
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
38
|
+
accessRight: z.enum(AccessRights)
|
|
39
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
40
|
+
propagationType: z.enum(["Descendants", "Children", "Entity"]).default("Entity")
|
|
41
|
+
.describe("The propagation type for the access right"),
|
|
42
|
+
securityPermission: z.enum(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
43
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
44
|
+
database: z.string().optional()
|
|
45
|
+
.describe("The database containing the item (defaults to the context database)"),
|
|
46
|
+
passThrough: z.boolean().optional()
|
|
47
|
+
.describe("")
|
|
48
|
+
}, async (params) => {
|
|
49
|
+
const command = `Add-ItemAcl`;
|
|
50
|
+
const options = {
|
|
51
|
+
"Path": params.path,
|
|
52
|
+
"Identity": params.identity,
|
|
53
|
+
"AccessRight": params.accessRight,
|
|
54
|
+
"PropagationType": params.propagationType,
|
|
55
|
+
"SecurityPermission": params.securityPermission
|
|
56
|
+
};
|
|
57
|
+
if (params.database) {
|
|
58
|
+
options["Database"] = params.database;
|
|
59
|
+
}
|
|
60
|
+
if (params.passThrough) {
|
|
61
|
+
options["PassThru"] = "";
|
|
62
|
+
}
|
|
63
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=register-add-item-acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-add-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-add-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,4DAA4D,EAC5D;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,yCAAyC,CAAC;QACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,6FAA6F,CAAC;QAC5G,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,YAAqC,CAAC;aACrD,QAAQ,CAAC,4DAA4D,CAAC;QAC3E,eAAe,EAAE,CAAC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owershellCommand } from "../generic.js";
|
|
4
|
+
export function registerClearItemAclPowerShell(server, config) {
|
|
5
|
+
server.tool("security-clear-item-acl-by-id", "Clears all access rules from a Sitecore item by its ID.", {
|
|
6
|
+
id: z.string()
|
|
7
|
+
.describe("The ID of the item to clear ACL for"),
|
|
8
|
+
passThru: z.boolean().optional()
|
|
9
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
10
|
+
database: z.string().optional()
|
|
11
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
12
|
+
}, async (params) => {
|
|
13
|
+
const command = `Clear-ItemAcl`;
|
|
14
|
+
const options = {
|
|
15
|
+
"ID": params.id,
|
|
16
|
+
};
|
|
17
|
+
if (params.passThru) {
|
|
18
|
+
options["PassThru"] = "";
|
|
19
|
+
}
|
|
20
|
+
if (params.database) {
|
|
21
|
+
options["Database"] = params.database;
|
|
22
|
+
}
|
|
23
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24
|
+
});
|
|
25
|
+
server.tool("security-clear-item-acl-by-path", "Clears all access rules from a Sitecore item by its path.", {
|
|
26
|
+
path: z.string()
|
|
27
|
+
.describe("The path of the item to clear ACL for (e.g. /sitecore/content/Home)"),
|
|
28
|
+
passThru: z.boolean().optional()
|
|
29
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
30
|
+
database: z.string().optional()
|
|
31
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
32
|
+
}, async (params) => {
|
|
33
|
+
const command = `Clear-ItemAcl`;
|
|
34
|
+
const options = {
|
|
35
|
+
"Path": params.path,
|
|
36
|
+
};
|
|
37
|
+
if (params.passThru) {
|
|
38
|
+
options["PassThru"] = "";
|
|
39
|
+
}
|
|
40
|
+
if (params.database) {
|
|
41
|
+
options["Database"] = params.database;
|
|
42
|
+
}
|
|
43
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=register-clear-item-acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-clear-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-clear-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,8BAA8B,CAAC,MAAiB,EAAE,MAAc;IAC5E,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,yDAAyD,EACzD;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,qCAAqC,CAAC;QACpD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,eAAe,CAAC;QAChC,MAAM,OAAO,GAAwB;YACjC,IAAI,EAAE,MAAM,CAAC,EAAE;SAClB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACP,iCAAiC,EACjC,2DAA2D,EAC3D;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,qEAAqE,CAAC;QACpF,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,eAAe,CAAC;QAChC,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerGetItemAclPowerShell(server, config) {
|
|
5
|
+
server.tool("security-get-item-acl-by-id", "Gets the access control list (ACL) of a Sitecore item by its ID.", {
|
|
6
|
+
id: z.string()
|
|
7
|
+
.describe("The ID of the item to get ACL for"),
|
|
8
|
+
includeInherited: z.boolean().optional()
|
|
9
|
+
.describe("If set to true, includes inherited ACL entries"),
|
|
10
|
+
includeSystem: z.boolean().optional()
|
|
11
|
+
.describe("If set to true, includes system ACL entries"),
|
|
12
|
+
database: z.string().optional()
|
|
13
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
14
|
+
}, async (params) => {
|
|
15
|
+
const command = `Get-ItemAcl`;
|
|
16
|
+
const options = {
|
|
17
|
+
"ID": params.id,
|
|
18
|
+
};
|
|
19
|
+
if (params.includeInherited) {
|
|
20
|
+
options["IncludeInherited"] = "";
|
|
21
|
+
}
|
|
22
|
+
if (params.includeSystem) {
|
|
23
|
+
options["IncludeSystem"] = "";
|
|
24
|
+
}
|
|
25
|
+
if (params.database) {
|
|
26
|
+
options["Database"] = params.database;
|
|
27
|
+
}
|
|
28
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
29
|
+
});
|
|
30
|
+
server.tool("security-get-item-acl-by-path", "Gets the access control list (ACL) of a Sitecore item by its path.", {
|
|
31
|
+
path: z.string()
|
|
32
|
+
.describe("The path of the item to get ACL for (e.g. /sitecore/content/Home)"),
|
|
33
|
+
includeInherited: z.boolean().optional()
|
|
34
|
+
.describe("If set to true, includes inherited ACL entries"),
|
|
35
|
+
includeSystem: z.boolean().optional()
|
|
36
|
+
.describe("If set to true, includes system ACL entries"),
|
|
37
|
+
database: z.string().optional()
|
|
38
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
39
|
+
}, async (params) => {
|
|
40
|
+
const command = `Get-ItemAcl`;
|
|
41
|
+
const options = {
|
|
42
|
+
"Path": params.path,
|
|
43
|
+
};
|
|
44
|
+
if (params.includeInherited) {
|
|
45
|
+
options["IncludeInherited"] = "";
|
|
46
|
+
}
|
|
47
|
+
if (params.includeSystem) {
|
|
48
|
+
options["IncludeSystem"] = "";
|
|
49
|
+
}
|
|
50
|
+
if (params.database) {
|
|
51
|
+
options["Database"] = params.database;
|
|
52
|
+
}
|
|
53
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=register-get-item-acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-get-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/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AAC,CACJ,CAAC;IAEF,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,oEAAoE,EACpE;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,mEAAmE,CAAC;QAClF,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aACnC,QAAQ,CAAC,gDAAgD,CAAC;QAC/D,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAChC,QAAQ,CAAC,6CAA6C,CAAC;QAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC1B,OAAO,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC;QACrC,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;QAClC,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -4,6 +4,8 @@ import { registerRemoveUserPowerShell } from "./register-remove-user.js";
|
|
|
4
4
|
import { registerDisableUserPowerShell } from "./register-disable-user.js";
|
|
5
5
|
import { registerEnableUserPowerShell } from "./register-enable-user.js";
|
|
6
6
|
import { registerUnlockUserPowerShell } from "./register-unlock-user.js";
|
|
7
|
+
import { registerSetUserPowerShell } from "./register-set-user.js";
|
|
8
|
+
import { registerSetUserPasswordPowerShell } from "./register-set-user-password.js";
|
|
7
9
|
import { registerGetDomainPowerShell } from "./register-get-domain.js";
|
|
8
10
|
import { registerGetRolePowerShell } from "./register-get-role.js";
|
|
9
11
|
import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
|
|
@@ -18,6 +20,10 @@ import { registerRemoveRolePowerShell } from "./register-remove-role.js";
|
|
|
18
20
|
import { registerNewDomainPowerShell } from "./register-new-domain.js";
|
|
19
21
|
import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
|
|
20
22
|
import { registerTestAccountPowerShell } from "./register-test-account.js";
|
|
23
|
+
import { registerGetItemAclPowerShell } from "./register-get-item-acl.js";
|
|
24
|
+
import { registerTestItemAclPowerShell } from "./register-test-item-acl.js";
|
|
25
|
+
import { registerAddItemAclPowerShell } from "./register-add-item-acl.js";
|
|
26
|
+
import { registerClearItemAclPowerShell } from "./register-clear-item-acl.js";
|
|
21
27
|
export function registerSecurityPowerShell(server, config) {
|
|
22
28
|
registerGetUserPowerShell(server, config);
|
|
23
29
|
registerNewUserPowerShell(server, config);
|
|
@@ -25,6 +31,8 @@ export function registerSecurityPowerShell(server, config) {
|
|
|
25
31
|
registerDisableUserPowerShell(server, config);
|
|
26
32
|
registerEnableUserPowerShell(server, config);
|
|
27
33
|
registerUnlockUserPowerShell(server, config);
|
|
34
|
+
registerSetUserPowerShell(server, config);
|
|
35
|
+
registerSetUserPasswordPowerShell(server, config);
|
|
28
36
|
registerGetDomainPowerShell(server, config);
|
|
29
37
|
registerGetRolePowerShell(server, config);
|
|
30
38
|
registerGetRoleMemberPowerShell(server, config);
|
|
@@ -39,5 +47,9 @@ export function registerSecurityPowerShell(server, config) {
|
|
|
39
47
|
registerNewDomainPowerShell(server, config);
|
|
40
48
|
registerRemoveDomainPowerShell(server, config);
|
|
41
49
|
registerTestAccountPowerShell(server, config);
|
|
50
|
+
registerGetItemAclPowerShell(server, config);
|
|
51
|
+
registerTestItemAclPowerShell(server, config);
|
|
52
|
+
registerAddItemAclPowerShell(server, config);
|
|
53
|
+
registerClearItemAclPowerShell(server, config);
|
|
42
54
|
}
|
|
43
55
|
//# sourceMappingURL=register-security-powershell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE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A6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerSetUserPasswordPowerShell(server, config) {
|
|
5
|
+
server.tool("security-set-user-password", "Sets a new password for a Sitecore user.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the user to update the password for (e.g. 'admin' or full path 'sitecore\\admin')"),
|
|
8
|
+
newPassword: z.string()
|
|
9
|
+
.describe("The new password for the user"),
|
|
10
|
+
resetPassword: z.boolean().optional()
|
|
11
|
+
.describe("If true, the user will be required to change password on next login"),
|
|
12
|
+
oldPassword: z.string().optional()
|
|
13
|
+
.describe("The old password. If provided, it will be validated before setting the new password"),
|
|
14
|
+
}, async (params) => {
|
|
15
|
+
const command = `Set-UserPassword`;
|
|
16
|
+
const options = {
|
|
17
|
+
"Identity": params.identity,
|
|
18
|
+
"NewPassword": params.newPassword,
|
|
19
|
+
};
|
|
20
|
+
if (params.resetPassword) {
|
|
21
|
+
options["Reset"] = "";
|
|
22
|
+
}
|
|
23
|
+
if (params.oldPassword) {
|
|
24
|
+
options["OldPassword"] = params.oldPassword;
|
|
25
|
+
}
|
|
26
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=register-set-user-password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-set-user-password.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-set-user-password.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,iCAAiC,CAAC,MAAiB,EAAE,MAAc;IAC/E,MAAM,CAAC,IAAI,CACP,4BAA4B,EAC5B,0CAA0C,EAC1C;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,mGAAmG,CAAC;QAClH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;aAClB,QAAQ,CAAC,+BAA+B,CAAC;QAC9C,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAChC,QAAQ,CAAC,qEAAqE,CAAC;QACpF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC7B,QAAQ,CAAC,qFAAqF,CAAC;KACvG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,kBAAkB,CAAC;QACnC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,aAAa,EAAE,MAAM,CAAC,WAAW;SACpC,CAAC;QAEF,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAChD,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerSetUserPowerShell(server, config) {
|
|
5
|
+
server.tool("security-set-user", "Updates properties of a Sitecore user account.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the user to update (e.g. 'admin' or full path 'sitecore\\admin')"),
|
|
8
|
+
isAdministrator: z.boolean().optional()
|
|
9
|
+
.describe("Set the user as an administrator"),
|
|
10
|
+
password: z.string().optional()
|
|
11
|
+
.describe("The new password for the user"),
|
|
12
|
+
comment: z.string().optional()
|
|
13
|
+
.describe("Comment for the user"),
|
|
14
|
+
email: z.string().optional()
|
|
15
|
+
.describe("Email for the user"),
|
|
16
|
+
fullName: z.string().optional()
|
|
17
|
+
.describe("Full name of the user"),
|
|
18
|
+
portrait: z.string().optional()
|
|
19
|
+
.describe("Portrait for the user"),
|
|
20
|
+
profileItemId: z.string().optional()
|
|
21
|
+
.describe("Profile item ID for the user"),
|
|
22
|
+
startUrl: z.string().optional()
|
|
23
|
+
.describe("Start URL for the user"),
|
|
24
|
+
clientLanguage: z.string().optional()
|
|
25
|
+
.describe("Client language for the user"),
|
|
26
|
+
enabled: z.boolean().optional()
|
|
27
|
+
.describe("Enable or disable the user"),
|
|
28
|
+
}, async (params) => {
|
|
29
|
+
const command = `Set-User`;
|
|
30
|
+
const options = {
|
|
31
|
+
"Identity": params.identity,
|
|
32
|
+
};
|
|
33
|
+
if (params.password) {
|
|
34
|
+
options["Password"] = params.password;
|
|
35
|
+
}
|
|
36
|
+
if (params.comment) {
|
|
37
|
+
options["Comment"] = params.comment;
|
|
38
|
+
}
|
|
39
|
+
if (params.email) {
|
|
40
|
+
options["Email"] = params.email;
|
|
41
|
+
}
|
|
42
|
+
if (params.fullName) {
|
|
43
|
+
options["FullName"] = params.fullName;
|
|
44
|
+
}
|
|
45
|
+
if (params.portrait) {
|
|
46
|
+
options["Portrait"] = params.portrait;
|
|
47
|
+
}
|
|
48
|
+
if (params.startUrl) {
|
|
49
|
+
options["StartUrl"] = params.startUrl;
|
|
50
|
+
}
|
|
51
|
+
if (params.clientLanguage) {
|
|
52
|
+
options["ClientLanguage"] = params.clientLanguage;
|
|
53
|
+
}
|
|
54
|
+
if (params.profileItemId) {
|
|
55
|
+
options["ProfileItemId"] = params.profileItemId;
|
|
56
|
+
}
|
|
57
|
+
if (params.isAdministrator) {
|
|
58
|
+
options["IsAdministrator"] = params.isAdministrator;
|
|
59
|
+
}
|
|
60
|
+
if (params.enabled) {
|
|
61
|
+
options["Enabled"] = params.enabled;
|
|
62
|
+
}
|
|
63
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=register-set-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-set-user.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-set-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAc;IACvE,MAAM,CAAC,IAAI,CACP,mBAAmB,EACnB,gDAAgD,EAChD;QACI,QAAQ,EAAE,CAAC,CAAC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|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
import { AccessRights } from "./access-rights.js";
|
|
5
|
+
export function registerTestItemAclPowerShell(server, config) {
|
|
6
|
+
server.tool("security-test-item-acl-by-id", "Tests whether a user or role has specific access rights to a Sitecore item by its ID.", {
|
|
7
|
+
id: z.string()
|
|
8
|
+
.describe("The ID of the item to test access rights on"),
|
|
9
|
+
identity: z.string()
|
|
10
|
+
.describe("The identity of the user or role to test (e.g. 'sitecore\\admin')"),
|
|
11
|
+
accessRight: z.enum(AccessRights)
|
|
12
|
+
.describe("The access right to test (e.g. 'item:read', 'item:write')"),
|
|
13
|
+
propType: z.enum(["Descendants", "Children", "Entity"]).optional()
|
|
14
|
+
.describe("The propagation type for the access right"),
|
|
15
|
+
database: z.string().optional()
|
|
16
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
17
|
+
}, async (params) => {
|
|
18
|
+
const command = `Test-ItemAcl`;
|
|
19
|
+
const options = {
|
|
20
|
+
"ID": params.id,
|
|
21
|
+
"Identity": params.identity,
|
|
22
|
+
"AccessRight": params.accessRight,
|
|
23
|
+
};
|
|
24
|
+
if (params.propType) {
|
|
25
|
+
options["PropType"] = params.propType;
|
|
26
|
+
}
|
|
27
|
+
if (params.database) {
|
|
28
|
+
options["Database"] = params.database;
|
|
29
|
+
}
|
|
30
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
31
|
+
});
|
|
32
|
+
server.tool("security-test-item-acl-by-path", "Tests whether a user or role has specific access rights to a Sitecore item by its path.", {
|
|
33
|
+
path: z.string()
|
|
34
|
+
.describe("The path of the item to test access rights on (e.g. /sitecore/content/Home)"),
|
|
35
|
+
identity: z.string()
|
|
36
|
+
.describe("The identity of the user or role to test (e.g. 'sitecore\\admin')"),
|
|
37
|
+
accessRight: z.string()
|
|
38
|
+
.describe("The access right to test (e.g. 'item:read', 'item:write')"),
|
|
39
|
+
propType: z.enum(["Descendants", "Children", "Entity"]).optional()
|
|
40
|
+
.describe("The propagation type for the access right"),
|
|
41
|
+
database: z.string().optional()
|
|
42
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
43
|
+
}, async (params) => {
|
|
44
|
+
const command = `Test-ItemAcl`;
|
|
45
|
+
const options = {
|
|
46
|
+
"Path": params.path,
|
|
47
|
+
"Identity": params.identity,
|
|
48
|
+
"AccessRight": params.accessRight,
|
|
49
|
+
};
|
|
50
|
+
if (params.propType) {
|
|
51
|
+
options["PropType"] = params.propType;
|
|
52
|
+
}
|
|
53
|
+
if (params.database) {
|
|
54
|
+
options["Database"] = params.database;
|
|
55
|
+
}
|
|
56
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=register-test-item-acl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-test-item-acl.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-test-item-acl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,8BAA8B,EAC9B,uFAAuF,EACvF;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,6CAA6C,CAAC;QAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,mEAAmE,CAAC;QAClF,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,YAAqC,CAAC;aACrD,QAAQ,CAAC,2DAA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Q,CAAC,2CAA2C,CAAC;QAC1D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,aAAa,EAAE,MAAM,CAAC,WAAW;SACpC,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prepareArgsString(parameters: Record<string, any>): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function prepareArgsString(parameters) {
|
|
2
|
+
let scriptWithParameters = "";
|
|
3
|
+
if (parameters) {
|
|
4
|
+
for (const parameter in parameters) {
|
|
5
|
+
if (parameters[parameter] === "") {
|
|
6
|
+
scriptWithParameters += ` -${parameter}`;
|
|
7
|
+
}
|
|
8
|
+
else if (Array.isArray(parameters[parameter])) {
|
|
9
|
+
scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
scriptWithParameters += ` -${parameter} "${parameters[parameter]}"`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return scriptWithParameters;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/tools/powershell/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC7D,IAAI,oBAAoB,GAAG,EAAE,CAAC;IAC9B,IAAI,UAAU,EAAE,CAAC;QACb,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC/B,oBAAoB,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,CAAC;iBACI,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;gBAC5C,oBAAoB,IAAI,KAAK,SAAS,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;YACpF,CAAC;iBAAM,CAAC;gBACJ,oBAAoB,IAAI,KAAK,SAAS,KAAK,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC;YACxE,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC"}
|