Skip to content

Commit

Permalink
Addresses comments from pull-71
Browse files Browse the repository at this point in the history
* Adds check to allow "/" or no "/" in permissions file
* Renames policy definition file to markdown
  • Loading branch information
ross-desmond committed Jan 9, 2019
1 parent 597f1bd commit 3c4f981
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions sros2/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ def create_permission_file(path, name, domain_id, permissions_dict):
topic_dict['/clock'] = {'allow': ['subscribe']}
# we have some policies to add !
for topic_name, policy in topic_dict.items():
# add a "/" if it doesn't exist
formatted_topic_name = "/" + (topic_name.lstrip('/'))
tags = []
publish = 'publish'
subscribe = 'subscribe'
Expand All @@ -411,9 +413,8 @@ def create_permission_file(path, name, domain_id, permissions_dict):
<topic>%s</topic>
</topics>
</%s>
""" % (tag, 'rt' + topic_name, tag)
""" % (tag, 'rt' + formatted_topic_name, tag)
# TODO(mikaelarguedas) remove this hardcoded handling for default parameter topics

service_dict = permissions_dict['services']
default_parameter_topics = [
'describe_parameters',
Expand Down

0 comments on commit 3c4f981

Please sign in to comment.