Skip to content

Commit

Permalink
only the user themselves can update their public key
Browse files Browse the repository at this point in the history
  • Loading branch information
giosakti committed Dec 16, 2018
1 parent 4ceccc3 commit f011fae
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions app/views/users/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,21 @@
br
.card
.card-body
h6.card-title Public Key
= form_tag user_public_key_update_path, method: :post do
.row
.col
= text_area_tag "public_key", @user.public_key, class: "form-contol text-align-top", style: "height:200px;width:100%;", placeholder: "Your public key here..."
br
.row
.col-md-3
= submit_tag "Update key", class: "form-control btn-md btn-primary"
- if (current_user.admin? or (current_user.id == @user.id))
h6.card-title Public Key
= form_tag user_public_key_update_path, method: :post do
.row
.col
= text_area_tag "public_key", @user.public_key, class: "form-contol text-align-top", style: "height:200px;width:100%;", placeholder: "Your public key here..."
br
.row
.col-md-3
= submit_tag "Update key", class: "form-control btn-md btn-primary"
- else
h6.card-title Public Key
.row
.col
= @user.public_key

br
.card
Expand Down

0 comments on commit f011fae

Please sign in to comment.