msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Grant-MgSitePermission has invalid suffix in called URI
grant-mgsitepermission -permissionid 'read' -siteid 'hello' -verbose -debug
Debug URI Result:
https://graph.microsoft.com/v1.0/sites/hello/permissions/read/microsoft.graph.grant
The "microsoft.graph.grant" part is not part of the API unless I'm missing something: https://docs.microsoft.com/en-us/graph/api/site-post-permissions?view=graph-rest-1.0&tabs=http
Workaround
New-MgSitePermission works as expected
Thanks for bringing this to our attention.
According to the service metadata (our single source of truth), grant-mgsitepermission command is valid as it calls grant action that's bound to permission:
<Action Name="grant" IsBound="true">
<Parameter Name="bindingParameter" Type="graph.permission" />
<Parameter Name="roles" Type="Collection(Edm.String)" Unicode="false" />
<Parameter Name="recipients" Type="Collection(graph.driveRecipient)" />
<ReturnType Type="Collection(graph.permission)" />
</Action>
I'll reach out to the workload owner to understand if this is intentional or not.
Any update on this? Been a little while.
@joshtransient, still no response from the workload owner on this.
Is this a blocking issue? You should be able to perform all publicly documented operations on permissions using the module without any issue - https://learn.microsoft.com/en-us/graph/api/site-update-permission?view=graph-rest-1.0&tabs=powershell#request.
It is not a blocker for me. I've been using New-MgSitePermission and Update-MgSitePermission without issue. I try to keep an eye on the SharePoint-specific issues this module has so I know how best to direct my customers.
Got it! We just had an internal discussion on the issue. The API path/command is invalid and will be removed from the service CSDL metadata via a new annotation. The work to add the new annotation is still ongoing.
I've transferred the issue to the metadata repro under https://github.com/microsoftgraph/msgraph-metadata/issues/169#issuecomment-1349773447 for tracking.