Module: Ddr::Models::Governable

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/ddr/models/governable.rb

Instance Method Summary collapse

Instance Method Details

#copy_admin_policy_from(other) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ddr/models/governable.rb', line 34

def copy_admin_policy_from(other)
  # XXX In active-fedora 7.0 can do
  # self.admin_policy = other.admin_policy
  self.admin_policy_id = case
  when other.has_admin_policy?
    other.admin_policy_id
  when other.is_a?(Collection)
    other.pid
  end
  # self.admin_policy_id = other.admin_policy_id if other.has_admin_policy?
end

#inherited_licenseObject



30
31
32
# File 'lib/ddr/models/governable.rb', line 30

def inherited_license
  admin_policy.default_license if admin_policy
end

#inherited_permissionsObject



10
11
12
# File 'lib/ddr/models/governable.rb', line 10

def inherited_permissions
  admin_policy ? admin_policy.default_permissions : []
end

#inherited_rightsObject



14
15
16
# File 'lib/ddr/models/governable.rb', line 14

def inherited_rights
  admin_policy.datastreams[Ddr::Datastreams::DEFAULT_RIGHTS] if admin_policy
end