权限问题

dev_daiao
daiao 5 years ago
parent c2fc6df352
commit 4257028358

@ -42,8 +42,8 @@ class Hack < ApplicationRecord
end end
# 管理员 # 管理员
def manager? def manager?(user)
user_id == current_user.id || current_user.admin_or_business? user_id == user.id || user.admin_or_business?
end end
end end

@ -17,5 +17,5 @@ json.user do
end end
json.user_auth do json.user_auth do
json.manager @hack.manager? json.manager @hack.manager?(current_user)
end end
Loading…
Cancel
Save