SharePoint ECMAScript: Web.DoesUserHavePermissions()
Posted
by Donaldinio
on Stack Overflow
See other posts from Stack Overflow
or by Donaldinio
Published on 2010-05-12T19:41:06Z
Indexed on
2010/05/12
19:44 UTC
Read the original article
Hit count: 316
sharepoint2010
I am trying to determine the permission level of the current user using the ECMAScript client OM. The following code always returns 0. Any thoughts?
function Initialize() {
clientContext = new SP.ClientContext.get_current();
web = clientContext.get_web();
clientContext.load(web);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onSiteLoadSuccess), Function.createDelegate(this, this.onQueryFailed));
}
function isUserWebAdmin() {
var permissionMask = null;
permissionMask = new SP.BasePermissions();
permissionMask.set(SP.PermissionKind.manageWeb);
var result = new SP.BooleanResult();
result = web.doesUserHavePermissions(permissionMask);
alert(result.get_value())
}
© Stack Overflow or respective owner