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

[ENHANCEMENT] Deprecate -BlockEdit and -BlockDeletion parameters on Set-PnPLabel #2932

Closed
martinlingstuyl opened this issue Mar 23, 2023 · 13 comments · Fixed by #2934
Closed
Assignees
Labels
enhancement New feature or request

Comments

@martinlingstuyl
Copy link
Contributor

Using the commandlet Set-PnPLabel you can apply a default retention label to lists and libraries. While doing that you can use the -BlockEdit and -BlockDeletion parameters to configure label settings.

However, this has been a concern for some time (because these settings allow you to override the retention label settings in Microsoft Purview) That's the reason they have been disabled in the CSOM and REST API's. Using them is ignored by Microsoft, Microsoft will simply look up the correct values for both properties and use them in the label application.

You can test this by applying a record retention label as a default to a list or libary and specify $false as a value for BlockEdit and BlockDelete. (A record-type label should have the value true on both these parameters)
After applying the label you can retrieve the applied label settings. You'll see your falsy values have been ignored.

Set-PnPLabel -List "TestLibrary" -Label "Test Recordlabel" -BlockDeletion:$false -BlockEdit:$false
Get-PnPlabel -List "TestLibrary"

These properties should therefore be deprecated and removed from the codebase.

@martinlingstuyl martinlingstuyl added the enhancement New feature or request label Mar 23, 2023
@veronicageek veronicageek changed the title Deprecate -BlockEdit and -BlockDeletion parameters on Set-PnPLabel [ENHANCEMENT] Deprecate -BlockEdit and -BlockDeletion parameters on Set-PnPLabel Mar 23, 2023
@martinlingstuyl
Copy link
Contributor Author

Because this is a breaking change, is this something we should add to v2?

@gautamdsheth
Copy link
Collaborator

Hmm, if its disabled by CSOM/REST , maybe we can mark it as obsolete and point them to the correct cmdlet ?

cc @KoenZomers

@martinlingstuyl
Copy link
Contributor Author

Hi @gautamdsheth,

The commandlet should not be disabled itself. You can still set default retention labels on lists.
The only thing you can no longer do is customize the label settings by using blockDelete and blockEdit properties.

So these parameters are the only things that need to be deprecated.

@gautamdsheth
Copy link
Collaborator

Ahh ok, lets deprecate them then.
We can get rid of these params a bit later then sometime.

Would you like to submit a PR for that ?

@martinlingstuyl
Copy link
Contributor Author

You can assign me

@gautamdsheth
Copy link
Collaborator

Do we have any purview related cmdlet for this in PnP PowerShell ? Maybe we can guide users to that ?

@martinlingstuyl
Copy link
Contributor Author

I haven't found commandlets to manage Purview retention labels in PnP PowerShell. (We do have them in the CLI 😏)
What we do have in pnp powershell is the possibility to apply these retentionlabels to listitems.

@KoenZomers
Copy link
Collaborator

Correct, we don't have cmdlets yet to add/modify/remove Purview labels. I would very much welcome a PR on that if you have time @martinlingstuyl.

@martinlingstuyl
Copy link
Contributor Author

That's okay, I've worked with it a lot so that should not be hard. I'll add it to my backlog. 🤙

@martinlingstuyl
Copy link
Contributor Author

No promises on when though..

@gautamdsheth
Copy link
Collaborator

no worries @martinlingstuyl , thank you so much already for all your help 😊🙏

@gautamdsheth
Copy link
Collaborator

@martinlingstuyl - what's the API that you use in the CLI for adding/modifying/remove Purview labels ? I might try to take a stab at it :)

@martinlingstuyl
Copy link
Contributor Author

we use the Graph API for managing the labels. Feel free to look around in our codebase 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants