Skip to content

Commit 47f264e

Browse files
authored
Merge pull request #138 from yknx4/features/improvements
fix: only show token to repo admins
2 parents 27ec3e7 + 901f72e commit 47f264e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/librecov_web/live/repository_live/show.html.heex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</div>
1919
<div class="flex-shrink-0 mt-3 mt-sm-0 ms-sm-3">
2020
<span class="d-inline-block btn-group">
21+
<%= if @repository.permissions.admin == true do %>
2122
<div class="btn-group">
2223
<button class="btn btn-primary px-4 py-2 dropdown-toggle" type="button" id="dropdownMenuClickable" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false">
2324
<i class="fas fa-key me-1 opacity-50"></i> Show Token
@@ -27,6 +28,7 @@
2728
<li><pre><code><span class="dropdown-item"><%= @project.token %></span></code></pre></li>
2829
</ul>
2930
</div>
31+
<% end %>
3032
<div class="btn-group">
3133
<button class="btn btn-primary px-4 py-2 dropdown-toggle" type="button" id="dropdownMenuClickable2" data-bs-toggle="dropdown" data-bs-auto-close="false" aria-expanded="false">
3234
<i class="far fa-image me-1 opacity-50"></i> Get Badge

test/librecov_web/live/repository_live_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ defmodule Librecov.RepositoryLiveTest do
106106
created_at: "2011-01-26T19:01:12Z",
107107
updated_at: "2011-01-26T19:14:43Z",
108108
permissions: %{
109-
admin: false,
109+
admin: true,
110110
push: false,
111111
pull: true
112112
},
@@ -233,7 +233,7 @@ defmodule Librecov.RepositoryLiveTest do
233233
created_at: "2011-01-26T19:01:12Z",
234234
updated_at: "2011-01-26T19:14:43Z",
235235
permissions: %{
236-
admin: false,
236+
admin: true,
237237
push: false,
238238
pull: true
239239
},

0 commit comments

Comments
 (0)