Skip to content

Commit

Permalink
adminとメンターの権限を整理した
Browse files Browse the repository at this point in the history
  • Loading branch information
machida authored and mami-inuzuka committed Dec 8, 2021
1 parent 92c4fda commit 4520283
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Expand Up @@ -61,7 +61,7 @@ def set_page

def page_params
keys = %i[title body tag_list practice_id slug]
keys << :user_id if admin_login?
keys << :user_id if admin_or_mentor_login?
params.require(:page).permit(*keys)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/works_controller.rb
Expand Up @@ -50,7 +50,7 @@ def work_params
end

def set_my_work
@work = if admin_login?
@work = if admin_or_mentor_login?
Work.find(params[:id])
else
current_user.works.find(params[:id])
Expand Down
4 changes: 2 additions & 2 deletions app/views/application/_global_nav.slim
Expand Up @@ -16,7 +16,7 @@ nav.global-nav
i.fas.fa-fw.fa-book
.global-nav-links__link-label プラクティス
li.global-nav-links__item
- report_link = mentor_login? ? reports_unchecked_index_path : reports_path
- report_link = admin_or_mentor_login? ? reports_unchecked_index_path : reports_path
= link_to report_link, class: "global-nav-links__link #{current_link(/^reports/)}" do
.global-nav-links__link-icon
i.fas.fa-fw.fa-pen
Expand All @@ -30,7 +30,7 @@ nav.global-nav
= link_to products_link, class: "global-nav-links__link #{current_link(/^products/)}" do
.global-nav-links__link-icon
i.fas.fa-fw.fa-hand-paper
- if admin_login? || mentor_login? && Cache.unassigned_product_count.positive?
- if admin_or_mentor_login? && Cache.unassigned_product_count.positive?
.global-nav__item-count.a-notification-count.is-only-mentor
= Cache.unassigned_product_count
.global-nav-links__link-label 提出物
Expand Down
2 changes: 1 addition & 1 deletion app/views/products/_form.html.slim
Expand Up @@ -13,7 +13,7 @@
| プレビュー
.js-preview.is-long-text.markdown-form__preview
.form-item
- if admin_login?
- if admin_or_mentor_login?
.col-md-3.col-xs-6
.a-form-label
| 担当者
Expand Down

0 comments on commit 4520283

Please sign in to comment.