in ees_sharepoint/sync_sharepoint.py [0:0]
def get_roles(self, key, site, list_url, list_id, itemid):
"""Checks the permissions and returns the user roles.
:param key: key, a string value
:param site: site name to check the permission
:param list_url: list url to access the list
:param list_id: list id to check the permission
:param itemid: item id to check the permission
Returns:
roles: user roles
"""
if key == SITES:
rel_url = site
roles = self.permissions.fetch_users(key, rel_url)
elif key == LISTS:
rel_url = list_url
roles = self.permissions.fetch_users(key, rel_url, list_id=list_id)
else:
rel_url = list_url
roles = self.permissions.fetch_users(
key, rel_url, list_id=list_id, item_id=itemid
)
return roles