Merge remote-tracking branch 'origin/master' into gs-master

This commit is contained in:
David Yip
2017-11-27 11:29:04 -06:00
29 changed files with 440 additions and 6 deletions
+25
View File
@@ -0,0 +1,25 @@
# frozen_string_literal: true
class InvitePolicy < ApplicationPolicy
def index?
staff?
end
def create?
min_required_role?
end
def destroy?
owner? || staff?
end
private
def owner?
record.user_id == current_user&.id
end
def min_required_role?
current_user&.role?(Setting.min_invite_role)
end
end