lib/seek/permissions/policy_based_authorization.rb
#returns a list of the people that can manage this file
#which will be the contributor, and those that have manage permissions
returns a list of the people that can manage this file
which will be the contributor, and those that have manage permissions
returns a list of the people that can manage this file which will be the contributor and those that have manage permissions
def managers
        people=[]
        unless self.contributor.nil?
          people << self.contributor.person if self.contributor.kind_of?(User)
          people << self.contributor if self.contributor.kind_of?(Person)
        end
        self.policy.permissions.each do |perm|
          unless perm.contributor.nil? || perm.access_type!=Policy::MANAGING
            people << (perm.contributor) if perm.contributor.kind_of?(Person)
            people << (perm.contributor.person) if perm.contributor.kind_of?(User)
          end
        end
        people.uniq
      end
def managers people = [ ] unless self . contributor . nil? people << self . contributor . person if self . contributor . kind_of? ( User ) people << self . contributor if self . contributor . kind_of? ( Person ) end self . policy . permissions . each do | perm | unless perm . contributor . nil? || perm . access_type != Policy :: MANAGING people << ( perm . contributor ) if perm . contributor . kind_of? ( Person ) people << ( perm . contributor . person ) if perm . contributor . kind_of? ( User ) end end people . uniq end
returns a list of the people that can manage this file
which will be the contributor, and those that have manage permissions
returns a list of the people that can manage this file which will be the contributor and those that have manage permissions
#FIXME: how to handle projects as contributors - return all people or just specific people (pals or other role)?