Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #519 from patrick-rodgers/dev
Browse files Browse the repository at this point in the history
Fix for #509 - handle verbose mode for getUserEffectivePermissions
  • Loading branch information
patrick-rodgers committed Jul 5, 2017
2 parents 66b38b7 + 0e8e0f2 commit 093b4e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sharepoint/queryablesecurable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export class QueryableSecurable extends QueryableInstance {
public getUserEffectivePermissions(loginName: string): Promise<BasePermissions> {
const q = this.clone(Queryable, "getUserEffectivePermissions(@user)", true);
q.query.add("@user", `'${encodeURIComponent(loginName)}'`);
return q.getAs<BasePermissions>();
return q.get().then(r => {
// handle verbose mode
return r.hasOwnProperty("GetUserEffectivePermissions") ? r.GetUserEffectivePermissions : r;
});
}

/**
Expand Down

0 comments on commit 093b4e8

Please sign in to comment.