Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove old authorization code #3209

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/models/membership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class Membership < ActiveRecord::Base
joins(@parent).where(state: states[:active]).merge(parent_class.public_scope)
}

def self.joins_for
@parent
end

def disable!
inactive!
end
Expand Down
19 changes: 0 additions & 19 deletions app/models/user_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,6 @@ class UserGroup < ActiveRecord::Base
using: :trigram,
ranked_by: ":trigram"

def self.memberships_query(action, target)
target.memberships_for(action)
end

def self.joins_for
:memberships
end

def self.private_query(action, target, roles)
joins(:memberships).merge(target.memberships_for(action, self))
.where(memberships: { identity: false })
end

def self.user_can_access_scope(private_query, public_flag)
scope = where(id: private_query.select(:id))
scope = scope.or(public_scope) if public_flag
scope
end

def self.roles_allowed_to_access(action, klass=nil)
roles = case action
when :show, :index
Expand Down