Skip to content
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

New command: m365 spo folder sharinglink remove #5966

Open
Tracked by #3996
MathijsVerbeeck opened this issue Apr 5, 2024 · 6 comments · May be fixed by #5996
Open
Tracked by #3996

New command: m365 spo folder sharinglink remove #5966

MathijsVerbeeck opened this issue Apr 5, 2024 · 6 comments · May be fixed by #5996

Comments

@MathijsVerbeeck
Copy link
Contributor

MathijsVerbeeck commented Apr 5, 2024

Usage

m365 spo folder sharinglink remove [options]

Description

Removes a sharing link from a folder

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the file is located
--folderUrl [folderUrl] The server- or site-relative decoded URL of the folder. Specify either folderUrl or folderId but not both
--folderId [folderId] The unique ID (GUID) of the folder. Specify either folderUrl or folderId but not both
-i, --id <id> The sharing link ID
-f, --force Don't prompt for confirmation

Examples

Removes a specific sharing link from a folder by id without prompting for confirmation

m365 spo folder sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --folderId daebb04b-a773-4baa-b1d1-3625418e3234 --id 1 --force

Removes a specific sharing link from a folder by url with prompting for confirmation

m365 spo folder sharinglink remove --webUrl https://contoso.sharepoint.com/sites/demo --fileUrl /sites/demo/shared%20documents/Folder --id 1

Default properties

No response

Additional Info

The API call to removea sharing link can be found on the following documentation: https://learn.microsoft.com/en-us/graph/api/permission-delete?view=graph-rest-1.0&tabs=http

Please try to use the SP REST API v2.1 as much as possible to reduce the need for extra Graph permissions.

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Apr 5, 2024
@Adam-it
Copy link
Contributor

Adam-it commented Apr 10, 2024

you have a small glitch in -i, --id <id>] it should be -i, --id <id> without the ]. Also I would write sharing link ID instead of The ID of the sharing link.
Besides that LGTM 👍
@pnp/cli-for-microsoft-365-maintainers anyone else for a 👀

@milanholemans
Copy link
Contributor

milanholemans commented Apr 10, 2024

My remarks:

  • Instead of Removes a sharing link of a folder, I'd use Removes a sharing link from a folder
  • folderUrl: should allow server and site-relative URLs
  • folderId: unique ID are 2 words
  • Let's add a remark with the Graph docs for the request
  • Let's add a remark that says that we should use v2.1 SP REST API endpoint as much as possible, this to reduce the need for people to consent extra Microsoft Graph permissions on their app registration.

@Jwaegebaert
Copy link
Contributor

The specs look good enough for me. Would you like to work on this @MathijsVerbeeck, or open it up?

@MathijsVerbeeck
Copy link
Contributor Author

You can open it up. I do still have some research however on how to retrieve the driveitemid from a folder, as this is not that straightforward as with a file. Should I post this procedure on every command (maybe add it in the specs)?

@Jwaegebaert Jwaegebaert added help wanted feature request and removed needs peer review Needs second pair of eyes to review the spec or PR new feature labels Apr 16, 2024
@Saurabh7019
Copy link
Contributor

Can I take this as well? I will be working on the List command today.

@arjunumenon
Copy link
Member

All yours @Saurabh7019 . Thanks for your help!

Saurabh7019 added a commit to Saurabh7019/cli-microsoft365 that referenced this issue Apr 25, 2024
Saurabh7019 added a commit to Saurabh7019/cli-microsoft365 that referenced this issue May 3, 2024
Saurabh7019 added a commit to Saurabh7019/cli-microsoft365 that referenced this issue May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants