1 | import { addProp } from "@pnp/queryable";
|
2 | import { escapeQueryStrValue } from "../index.js";
|
3 | import { spPost } from "../operations.js";
|
4 | import { Web, _Web } from "../webs/types.js";
|
5 | import { SiteGroups, SiteGroup } from "./types.js";
|
6 | import "../security/web.js";
|
7 | addProp(_Web, "siteGroups", SiteGroups);
|
8 | addProp(_Web, "associatedOwnerGroup", SiteGroup);
|
9 | addProp(_Web, "associatedMemberGroup", SiteGroup);
|
10 | addProp(_Web, "associatedVisitorGroup", SiteGroup);
|
11 | _Web.prototype.createDefaultAssociatedGroups = async function (groupNameSeed, siteOwner, copyRoleAssignments = false, clearSubscopes = true, siteOwner2) {
|
12 | await this.breakRoleInheritance(copyRoleAssignments, clearSubscopes);
|
13 | const q = Web(this, "createDefaultAssociatedGroups(userLogin=@u,userLogin2=@v,groupNameSeed=@s)");
|
14 | q.query.set("@u", `'${escapeQueryStrValue(siteOwner || "")}'`);
|
15 | q.query.set("@v", `'${escapeQueryStrValue(siteOwner2 || "")}'`);
|
16 | q.query.set("@s", `'${escapeQueryStrValue(groupNameSeed || "")}'`);
|
17 | return spPost(q);
|
18 | };
|
19 |
|
\ | No newline at end of file |