Added minimal permissions for 'spo folder sharinglink' commands. Closes #7275#7449
Added minimal permissions for 'spo folder sharinglink' commands. Closes #7275#7449SmitaNachan wants to merge 1 commit into
Conversation
|
Thanks, we'll review it soon! |
Adam-it
left a comment
There was a problem hiding this comment.
@SmitaNachan awesome work so far but there are a few things that were missed.
May I kindly ask you to give it an another go before we make this a perfect merge 💪
You Rock 🤩
| | Resource | Permissions | | ||
| |------------|-----------------| | ||
| | SharePoint | Files.ReadWrite | | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Application"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | |
There was a problem hiding this comment.
shouldn't this be a Microsoft Graph resource here, as we are refering this those permissions scopes?
https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http
|
|
||
| <Global /> | ||
|
|
||
| ## Permissions |
There was a problem hiding this comment.
The problem is that the folder sharinglink add command also uses spo.getFolderServerRelativeUrl util in it's logic
which uses a SharePoint Rest API call, we should also the minimal scope required also to perform this.
| | Resource | Permissions | | ||
| |------------|-----------------| | ||
| | SharePoint | Files.ReadWrite | | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Application"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | |
There was a problem hiding this comment.
Also here I think we are referring to Microsoft Graph permission scopes.
Also here the command logic also uses spo.getFolderServerRelativeUrl which uses the SharePoint Rest API for which we will need minimal permission scopes as well
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | |
There was a problem hiding this comment.
Also here we should refer to Microsoft Graph permission scopes
Also the ReadWrite scope seems to extreme for a GET type command. I would expect Read scope would be enough, could we recheck this?
Also this command uses spo.getFolderServerRelativeUrl so it means we will need a minimal scope for this as well
| <TabItem value="Delegated"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|-----------------| | ||
| | SharePoint | Files.ReadWrite | | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Application"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | | ||
|
|
||
| </TabItem> |
There was a problem hiding this comment.
Same comment as for the get command.
We should refer to Microsoft Graph scopes. It seems ReadWrite scopes are to big for a LIST command type, I would expect Read is enough https://learn.microsoft.com/en-us/graph/api/driveitem-list-permissions?view=graph-rest-1.0&tabs=http
Also it uses the spo.getFolderServerRelativeUrl method which uses SP Rest API. We need to document minimal permissions also for this one
| <TabItem value="Delegated"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|-----------------| | ||
| | SharePoint | Files.ReadWrite | | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Application"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | | ||
|
|
There was a problem hiding this comment.
Also here, we should refer to Microsoft Graph scopes, and we need to document minial permissions for spo.getFolderServerRelativeUrl method which is SP REST API based method
| <TabItem value="Delegated"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|-----------------| | ||
| | SharePoint | Files.ReadWrite | | ||
|
|
||
| </TabItem> | ||
| <TabItem value="Application"> | ||
|
|
||
| | Resource | Permissions | | ||
| |------------|---------------------| | ||
| | SharePoint | Files.ReadWrite.All | | ||
|
|
||
| </TabItem> |
There was a problem hiding this comment.
And here as well:
- let's rename to
Microsoft Graphresource - let's add minimal scopes for
spo.getFolderServerRelativeUrlmethod
Added minimal permissions for
spo folder sharinglinkcommands. Closes #7275