Browse Source

FIX 解决合并请求的权限问题

tags/v3.0.3
jasder 5 years ago
parent
commit
c56f0ca7fc
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/models/organization.rb

+ 4
- 0
app/models/organization.rb View File

@@ -108,6 +108,10 @@ class Organization < Owner
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(read write admin owner)}).present?
end

def is_only_read?(user_id)
team_users.joins(:team).where(user_id: user_id, teams: {authorize: %w(read)}).present?
end

# 是不是所有者团队的最后一个成员
def is_owner_team_last_one?(user_id)
owner_team_users = team_users.joins(:team).where(teams: {authorize: %w(owner)})


Loading…
Cancel
Save