Merge branch 'sync_develop' into develop

This commit is contained in:
jasder 2021-04-29 23:18:56 +08:00
commit d71272146f
1 changed files with 4 additions and 0 deletions

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)})