Skip to content

Commit

Permalink
feat: update is_authorized method
Browse files Browse the repository at this point in the history
  • Loading branch information
cowan-macady committed Apr 11, 2023
1 parent fd18e91 commit 1c13102
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions indykite_sdk/authorization/is_authorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,16 @@ def is_authorized_property_filter(self, type_filter, value, resources=[], option


def request_resource(resources):
res = []
for r in resources:
actions = []
for a in r.actions:
actions.append(a)
res.append(pb2.IsAuthorizedRequest.Resource(id=r.id, type=r.type, actions=actions))
return res
return [
pb2.IsAuthorizedRequest.Resource(id=r.id, type=r.type, actions=list(r.actions))
for r in resources
]


def request_options(options):
options_dict = {}
try:
for k, v in options.items():
options_dict[k] = pb2_model.Option(string_value=str(v))
return options_dict
except Exception as exception:
return logger.logger_error(exception)
options_dict = {
k: pb2_model.Option(string_value=str(v))
for k, v in options.items()
}
return options_dict

0 comments on commit 1c13102

Please sign in to comment.