in ees_microsoft_outlook/enterprise_search_wrapper.py [0:0]
def list_permissions(self):
"""List permissions for one or all users"""
user_permission = []
try:
if self.version >= ENTERPRISE_V8:
user_permission = self.workplace_search_client.list_external_identities(
content_source_id=self.ws_source
)
else:
try:
user_permission = self.workplace_search_client.list_permissions(
content_source_id=self.ws_source,
)
except NotFoundError:
raise ValueError("Incompatible version")
self.logger.info(
"Successfully retrieves all permissions from the workplace"
)
except ValueError as error:
raise ValueError(
f"Please compare the Enterprise Search version used while running the installation \
to the version of Enterprise Search installed. Error: {error}"
)
except Exception as exception:
self.logger.exception(
f"Error while retrieving the permissions from the workplace. Error: {exception}"
)
return user_permission