UNPKG

10.9 kBTypeScriptView Raw
1import { _SPInstance, _SPCollection, ISPCollection, IDeleteable } from "../spqueryable.js";
2import { ISiteGroups } from "../site-groups/types.js";
3export declare type SecurableQueryable = _SPInstance & ISecurableMethods;
4/**
5 * Describes a set of role assignments for the current scope
6 *
7 */
8export declare class _RoleAssignments extends _SPCollection<IRoleAssignmentInfo[]> {
9 /**
10 * Gets the role assignment associated with the specified principal id from the collection.
11 *
12 * @param id The id of the role assignment
13 */
14 getById(id: number): IRoleAssignment;
15 /**
16 * Adds a new role assignment with the specified principal and role definitions to the collection
17 *
18 * @param principalId The id of the user or group to assign permissions to
19 * @param roleDefId The id of the role definition that defines the permissions to assign
20 *
21 */
22 add(principalId: number, roleDefId: number): Promise<void>;
23 /**
24 * Removes the role assignment with the specified principal and role definition from the collection
25 *
26 * @param principalId The id of the user or group in the role assignment
27 * @param roleDefId The id of the role definition in the role assignment
28 *
29 */
30 remove(principalId: number, roleDefId: number): Promise<void>;
31}
32export interface IRoleAssignments extends _RoleAssignments {
33}
34export declare const RoleAssignments: import("../spqueryable.js").ISPInvokableFactory<IRoleAssignments>;
35/**
36 * Describes a role assignment
37 *
38 */
39export declare class _RoleAssignment extends _SPInstance<IRoleAssignmentInfo> {
40 delete: (this: import("../spqueryable.js").ISPQueryable<any>) => Promise<void>;
41 /**
42 * Gets the groups that directly belong to the access control list (ACL) for this securable object
43 *
44 */
45 get groups(): ISiteGroups;
46 /**
47 * Gets the role definition bindings for this role assignment
48 *
49 */
50 get bindings(): ISPCollection;
51}
52export interface IRoleAssignment extends _RoleAssignment, IDeleteable {
53}
54export declare const RoleAssignment: import("../spqueryable.js").ISPInvokableFactory<IRoleAssignment>;
55/**
56 * Describes a collection of role definitions
57 *
58 */
59export declare class _RoleDefinitions extends _SPCollection<IRoleDefinitionInfo[]> {
60 /**
61 * Gets the role definition with the specified id from the collection
62 *
63 * @param id The id of the role definition
64 *
65 */
66 getById(id: number): IRoleDefinition;
67 /**
68 * Gets the role definition with the specified name
69 *
70 * @param name The name of the role definition
71 *
72 */
73 getByName(name: string): IRoleDefinition;
74 /**
75 * Gets the role definition with the specified role type
76 *
77 * @param roleTypeKind The roletypekind of the role definition (None=0, Guest=1, Reader=2, Contributor=3, WebDesigner=4, Administrator=5, Editor=6, System=7)
78 *
79 */
80 getByType(roleTypeKind: RoleTypeKind): IRoleDefinition;
81 /**
82 * Creates a role definition
83 *
84 * @param name The new role definition's name
85 * @param description The new role definition's description
86 * @param order The order in which the role definition appears
87 * @param basePermissions The permissions mask for this role definition, high and low values need to be converted to string
88 *
89 */
90 add(name: string, description: string, order: number, basePermissions: IBasePermissions): Promise<IRoleDefinitionAddResult>;
91}
92export interface IRoleDefinitions extends _RoleDefinitions {
93}
94export declare const RoleDefinitions: import("../spqueryable.js").ISPInvokableFactory<IRoleDefinitions>;
95/**
96 * Describes a role definition
97 *
98 */
99export declare class _RoleDefinition extends _SPInstance<IRoleDefinitionInfo> {
100 delete: (this: import("../spqueryable.js").ISPQueryable<any>) => Promise<void>;
101 /**
102 * Updates this role definition with the supplied properties
103 *
104 * @param properties A plain object hash of values to update for the role definition
105 */
106 update(properties: Partial<IRoleDefinitionInfo>): Promise<IRoleDefinitionUpdateResult>;
107}
108export interface IRoleDefinition extends _RoleDefinition, IDeleteable {
109}
110export declare const RoleDefinition: import("../spqueryable.js").ISPInvokableFactory<IRoleDefinition>;
111export interface ISecurableMethods {
112 readonly roleAssignments: IRoleAssignments;
113 readonly firstUniqueAncestorSecurableObject: _SPInstance;
114 getUserEffectivePermissions(loginName: string): Promise<IBasePermissions>;
115 getCurrentUserEffectivePermissions(): Promise<IBasePermissions>;
116 breakRoleInheritance(copyRoleAssignments?: boolean, clearSubscopes?: boolean): Promise<any>;
117 resetRoleInheritance(): Promise<any>;
118 userHasPermissions(loginName: string, permission: PermissionKind): Promise<boolean>;
119 currentUserHasPermissions(permission: PermissionKind): Promise<boolean>;
120 hasPermissions(value: IBasePermissions, perm: PermissionKind): boolean;
121}
122/**
123 * Result from updating a role definition
124 *
125 */
126export interface IRoleDefinitionUpdateResult {
127 definition: IRoleDefinition;
128 data: any;
129}
130/**
131 * Result from adding a role definition
132 *
133 */
134export interface IRoleDefinitionAddResult {
135 definition: IRoleDefinition;
136 data: any;
137}
138export interface IBasePermissions {
139 Low: number;
140 High: number;
141}
142export interface IRoleAssignmentInfo {
143 PrincipalId: number;
144}
145export interface IRoleDefinitionInfo {
146 BasePermissions: IBasePermissions;
147 Description: string;
148 Hidden: boolean;
149 Id: number;
150 Name: string;
151 Order: number;
152 RoleTypeKind: RoleTypeKind;
153}
154export declare type RoleTypeKind = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
155export declare enum PermissionKind {
156 /**
157 * Has no permissions on the Site. Not available through the user interface.
158 */
159 EmptyMask = 0,
160 /**
161 * View items in lists, documents in document libraries, and Web discussion comments.
162 */
163 ViewListItems = 1,
164 /**
165 * Add items to lists, documents to document libraries, and Web discussion comments.
166 */
167 AddListItems = 2,
168 /**
169 * Edit items in lists, edit documents in document libraries, edit Web discussion comments
170 * in documents, and customize Web Part Pages in document libraries.
171 */
172 EditListItems = 3,
173 /**
174 * Delete items from a list, documents from a document library, and Web discussion
175 * comments in documents.
176 */
177 DeleteListItems = 4,
178 /**
179 * Approve a minor version of a list item or document.
180 */
181 ApproveItems = 5,
182 /**
183 * View the source of documents with server-side file handlers.
184 */
185 OpenItems = 6,
186 /**
187 * View past versions of a list item or document.
188 */
189 ViewVersions = 7,
190 /**
191 * Delete past versions of a list item or document.
192 */
193 DeleteVersions = 8,
194 /**
195 * Discard or check in a document which is checked out to another user.
196 */
197 CancelCheckout = 9,
198 /**
199 * Create, change, and delete personal views of lists.
200 */
201 ManagePersonalViews = 10,
202 /**
203 * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
204 */
205 ManageLists = 12,
206 /**
207 * View forms, views, and application pages, and enumerate lists.
208 */
209 ViewFormPages = 13,
210 /**
211 * Make content of a list or document library retrieveable for anonymous users through SharePoint search.
212 * The list permissions in the site do not change.
213 */
214 AnonymousSearchAccessList = 14,
215 /**
216 * Allow users to open a Site, list, or folder to access items inside that container.
217 */
218 Open = 17,
219 /**
220 * View pages in a Site.
221 */
222 ViewPages = 18,
223 /**
224 * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using
225 * a Windows SharePoint Services compatible editor.
226 */
227 AddAndCustomizePages = 19,
228 /**
229 * Apply a theme or borders to the entire Site.
230 */
231 ApplyThemeAndBorder = 20,
232 /**
233 * Apply a style sheet (.css file) to the Site.
234 */
235 ApplyStyleSheets = 21,
236 /**
237 * View reports on Site usage.
238 */
239 ViewUsageData = 22,
240 /**
241 * Create a Site using Self-Service Site Creation.
242 */
243 CreateSSCSite = 23,
244 /**
245 * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
246 */
247 ManageSubwebs = 24,
248 /**
249 * Create a group of users that can be used anywhere within the site collection.
250 */
251 CreateGroups = 25,
252 /**
253 * Create and change permission levels on the Site and assign permissions to users
254 * and groups.
255 */
256 ManagePermissions = 26,
257 /**
258 * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer
259 * and WebDAV interfaces.
260 */
261 BrowseDirectories = 27,
262 /**
263 * View information about users of the Site.
264 */
265 BrowseUserInfo = 28,
266 /**
267 * Add or remove personal Web Parts on a Web Part Page.
268 */
269 AddDelPrivateWebParts = 29,
270 /**
271 * Update Web Parts to display personalized information.
272 */
273 UpdatePersonalWebParts = 30,
274 /**
275 * Grant the ability to perform all administration tasks for the Site as well as
276 * manage content, activate, deactivate, or edit properties of Site scoped Features
277 * through the object model or through the user interface (UI). When granted on the
278 * root Site of a Site Collection, activate, deactivate, or edit properties of
279 * site collection scoped Features through the object model. To browse to the Site
280 * Collection Features page and activate or deactivate Site Collection scoped Features
281 * through the UI, you must be a Site Collection administrator.
282 */
283 ManageWeb = 31,
284 /**
285 * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through
286 * SharePoint search if the list or document library has AnonymousSearchAccessList set.
287 */
288 AnonymousSearchAccessWebLists = 32,
289 /**
290 * Use features that launch client applications. Otherwise, users must work on documents
291 * locally and upload changes.
292 */
293 UseClientIntegration = 37,
294 /**
295 * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.
296 */
297 UseRemoteAPIs = 38,
298 /**
299 * Manage alerts for all users of the Site.
300 */
301 ManageAlerts = 39,
302 /**
303 * Create e-mail alerts.
304 */
305 CreateAlerts = 40,
306 /**
307 * Allows a user to change his or her user information, such as adding a picture.
308 */
309 EditMyUserInfo = 41,
310 /**
311 * Enumerate permissions on Site, list, folder, document, or list item.
312 */
313 EnumeratePermissions = 63,
314 /**
315 * Has all permissions on the Site. Not available through the user interface.
316 */
317 FullMask = 65
318}
319//# sourceMappingURL=types.d.ts.map
\No newline at end of file