I'm trying to get RoleDefinitionBindings
using REST GET call in python
The problem is that on some calls I get a proper response, i.e,
https://my_company.sharepoint.com/_api/Web/RoleAssignments(25)/RoleDefinitionBindings
but on the other I get 'Access denied'. I.e on
https://my_company.sharepoint.com/sites/Company/_api/Web/RoleAssignments(4)/RoleDefinitionBindings
I get
AccessDeniedError("403: https://my_company.sharepoint.com/sites/Company/_api/Web/RoleAssignments(4)/RoleDefinitionBindings: {'odata.error': {'code': '-2147024891, System.UnauthorizedAccessException', 'message': {'lang': 'en-US', 'value': 'Access denied. You do not have permission to perform this action or access this resource.'}}}")
I can't figure out what is the problem, I'm using all possible scopes for ShapePoint for my App in Active Directory:
"https://my_company.sharepoint.com/AllSites.FullControl",
"https://my_company.sharepoint.com/AllSites.Read",
"https://my_company.sharepoint.com/User.Read.All",
"https://my_company.sharepoint.com/AllSites.Manage",
"https://my_company.sharepoint.com/AllSites.Write",
"https://my_company.sharepoint.com/MyFiles.Read",
"https://my_company.sharepoint.com/MyFiles.Write",
"https://my_company.sharepoint.com/Sites.Search.All",
"https://my_company.sharepoint.com/TermStore.Read.All",
"https://my_company.sharepoint.com/TermStore.ReadWrite.All",
"https://my_company.sharepoint.com/User.ReadWrite.All"