mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
设置非public图片查看权限
This commit is contained in:
@@ -229,6 +229,7 @@ class AttachmentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
tip_exception(403, "您没有权限进入") if project.present? && !candown
|
tip_exception(403, "您没有权限进入") if project.present? && !candown
|
||||||
end
|
end
|
||||||
|
tip_exception(403, "您没有权限查看") if project.present? && !candown if @file.is_public == 0 && author_id != current_user.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
class IdentityVerification < ApplicationRecord
|
class IdentityVerification < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2}
|
enum state: { "待审核": 0, "已通过": 1, "已拒绝": 2}
|
||||||
|
after_create do
|
||||||
|
Attachment.where(id:[card_front,card_back,hold_card_front,hold_card_back]).update_all(is_public:0)
|
||||||
|
end
|
||||||
|
|
||||||
after_save do
|
after_save do
|
||||||
if state == "已通过"
|
if state == "已通过"
|
||||||
|
|||||||
Reference in New Issue
Block a user