Skip to content

Commit

Permalink
📝Documentation: Hyperlink each Role name from Permissions Reference p…
Browse files Browse the repository at this point in the history
…age to Roles page

Signed-off-by: Ankita Sahu <[email protected]>
  • Loading branch information
SAHU-01 committed Jul 28, 2024
1 parent c2f68c7 commit 179d0ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
15 changes: 14 additions & 1 deletion layouts/shortcodes/csvtable-roles.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@
$uniqueCategories = $uniqueCategories | append $header }} {{ end }} {{ end }} {{
end }} {{end}} {{ range $index, $category := $uniqueCategories }}
<div class="csvtable-div">
<h2>{{ $category }} Role</h2>
{{ $sectionName := $category | lower }}
{{ $urlPath := "roles" }}
{{ if hasPrefix $sectionName "workspace" }}
{{ $urlPath = "roles/workspace-roles" }}
{{ else if hasPrefix $sectionName "team" }}
{{ $urlPath = "roles/team-roles" }}
{{ else if hasPrefix $sectionName "org" }}
{{ $urlPath = "roles/organization-roles" }}
{{ else if hasPrefix $sectionName "provider" }}
{{ $urlPath = "roles/#provider-admin-role" }}
{{ else }}
{{ $urlPath = print "roles/" $sectionName | urlize }}
{{ end }}
<h2><a href="/cloud/security/{{ $urlPath }}" target="_blank">{{ $category }} Role</a></h2>
<table class="csvtable td-initial">
<thead>
<tr>
Expand Down
17 changes: 16 additions & 1 deletion layouts/shortcodes/csvtable.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,22 @@ <h2>{{ $category }} Permissions</h2>
{{ else if eq $col "Feature" }}
<th>Description</th>
{{ else }}
<th>{{ $col }}</th>
{{ $sectionName := $col | lower }}
{{ $urlPath := "roles" }}
{{ if hasPrefix $sectionName "workspace" }}
{{ $urlPath = "roles/workspace-roles" }}
{{ else if hasPrefix $sectionName "team" }}
{{ $urlPath = "roles/team-roles" }}
{{ else if hasPrefix $sectionName "org" }}
{{ $urlPath = "roles/organization-roles" }}
{{ else if hasPrefix $sectionName "provider" }}
{{ $urlPath = "roles/#provider-admin-role" }}
{{ else if hasPrefix $sectionName "user" }}
{{ $urlPath = "roles/user-role" }}
{{ else }}
{{ $urlPath = print "roles/" }}
{{ end }}
<th><a href="/cloud/security/{{ $urlPath }}" target="_blank">{{ $col }}</a></th>
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit 179d0ff

Please sign in to comment.