Skip to content

Commit

Permalink
remove old authorization code (zooniverse#3209)
Browse files Browse the repository at this point in the history
some of this is very old, others has moved to *_policy.rb code.
  • Loading branch information
camallen authored and zwolf committed Mar 24, 2020
1 parent d3ec8b6 commit 6022e71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
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

0 comments on commit 6022e71

Please sign in to comment.