-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetUserEffectivePermissions not working with External accounts #1350
Comments
@FlorianLabranche : did you verify if calling the _api/web/getusereffectivepermissions(user UPN | User ID) does work for external accounts? |
@jansenbe : I just tried SP API.
But I tried using the SP LoginName I looked into your code and saw that you build the SP LoginName but the UPN is not encoded. I finally tested by encoding the UPN when calling
Note: UPN is the External one with #EXT#. Those '#' are the cause of the issue. Conclusion: |
@FlorianLabranche : I've implemented a fix, now using the UPN value for external users works directly with the method: var basePermissions = await context.Web.GetUserEffectivePermissionsAsync("bert_contoso.com#ext#@fabrikam.onmicrosoft.com"); |
Will appear in the next nightly, closing this issue now |
Thank you! |
Category
Describe the bug
Working in a SharePoint tenant (@contosodev.com) with External users from a second tenant (@contoso.com).
When I use GetUserEffectivePermissionsAsync() with an External user, I get 0 as High and Low permission mask.
Steps to reproduce
All requests are executed on tenant contosodev.sharepoint.com
Using External User primary UPN ([email protected])
EnsureUserAsync("[email protected]")
GetUserEffectivePermissionsAsync("[email protected]")
I got 0 as High and 0 as low :Using External User UPN (florian.labranche_contoso.com#ext#@contosodev.onmicrosoft.com)
GetUserEffectivePermissionsAsync("florian.labranche_contoso.com#ext#@contosodev.onmicrosoft.com")
I have the following error:The expression "web/getusereffectivepermissions('i:0#.f|membership|florian.labranche_contoso.com" is not valid.
Expected behavior
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: