Skip to content

Commit

Permalink
Address python feedback, remove TOC from rbac permissions page
Browse files Browse the repository at this point in the history
  • Loading branch information
bgdeutsch authored and davidejones committed Feb 5, 2021
1 parent 96d6cd1 commit 27385a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions content/en/account_management/rbac/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Datadog Role Permissions
kind: documentation
aliases:
- /account_management/faq/managing-global-role-permissions
disable_toc: true
further_reading:
- link: '/account_management/rbac/'
tag: 'Documentation'
Expand Down
6 changes: 4 additions & 2 deletions local/bin/py/build/pull_rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import requests
import json
from os import getenv
from collections import defaultdict

def pull_rbac():
api_endpoint = 'https://app.datadoghq.com/api/v2/permissions'
headers = {'DD-API-KEY': sys.argv[1], 'DD-APPLICATION-KEY': sys.argv[2]}
formatted_permissions_dict = {}
formatted_permissions_dict = defaultdict(list)

r = requests.get(api_endpoint, headers=headers)

Expand All @@ -22,7 +23,7 @@ def pull_rbac():

# Remove legacy logs permissions from dictionary before converting to JSON. These legacy permissions are hard-coded in rbac-permissions-table partial until they can be deprecated.
if permission_name in ('logs_live_tail', 'logs_read_index_data'):
del permission
continue
else:
if group_name not in formatted_permissions_dict.keys():
formatted_permissions_dict[group_name] = [permission]
Expand All @@ -35,6 +36,7 @@ def pull_rbac():
outfile.write(formatted_permissions_json)
else:
print('RBAC api request failed.')
print(r)

if getenv("LOCAL") != 'True':
sys.exit(1)
Expand Down

0 comments on commit 27385a3

Please sign in to comment.