Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

BasePermissions.to_json() issue?

Open dksdarkness opened this issue 7 months ago • 2 comments

Hi there! 👋

First of all, thank you for this great library — it's been very helpful!

While migrating roles from one SharePoint site to another, I encountered some unexpected behavior. Upon investigating, I noticed the following method in base_permissions.py:

https://github.com/vgrem/Office365-REST-Python-Client/blob/master/office365/sharepoint/permissions/base_permissions.py:

def to_json(self, json_format=None): return {"Low": str(self.High), "High": str(self.Low)}

Shouldn't it be the other way around?:

{"Low": str(self.Low), "High": str(self.High)}

Best Regards!

dksdarkness avatar May 06 '25 05:05 dksdarkness

Greetings!

Thank you for catching it, it appears variables themselves are misnamed here: self.High actually stores the Low value, and self.Low stores the High value. Thanks, it will be addresed in the upcoming version.

vgrem avatar Jun 24 '25 12:06 vgrem

I'm happy to help!

Thank yoy for all your efforts!!

dksdarkness avatar Jun 25 '25 05:06 dksdarkness