Skip to content

Commit

Permalink
Merge pull request #4913 from himeshsiriwardana/turn-off-default-roles
Browse files Browse the repository at this point in the history
if env variable is not set, condition will be true
  • Loading branch information
himeshsiriwardana authored Dec 4, 2024
2 parents b7a68f6 + 310057f commit 118c340
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion en/asgardeo/docs/references/user-management/user-roles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if default_roles == true %}
{% if default_roles %}

# Asgardeo user roles

Expand Down
12 changes: 8 additions & 4 deletions en/asgardeo/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ def remove_nav_item(nav_items):
return filtered_items

def on_config(config):
if os.getenv("ENABLE_HOOKS") == "true":
for feature, enabled in files_to_remove['feature'].items():
config[feature] = enabled
enable_hooks = os.getenv("ENABLE_HOOKS")

for feature, enabled in files_to_remove['feature'].items():
config[feature] = enabled if enable_hooks else True


if enable_hooks:
config['nav'] = remove_nav_item(config['nav'])
return config

return config

0 comments on commit 118c340

Please sign in to comment.