Sha256: 066fee560959b642cccb49d89cf707feb8c6575d1d1f56d8912309a2590a8397

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

class ChildResource < ActiveRecord::Base
  belongs_to :parent_resource
  attr_accessible :description, :name, :parent_resource_id

  include Alberich::PermissionedObject

  # for objects with a user or owner attribute, owner-level privileges
  # can automatically be conferred with the following
  #   after_create "assign_owner_roles(owner)"
  # otherwise this will need to be handled explicitly in the
  # controller create action

  # We don't need to override perm_ancestors since this type doesn't
  # inherit from anything
  def perm_ancestors
    super + [parent_resource]
  end

  # We don't need to override derived_subtree since nothing inherits
  # from this type

  # We don't need to override additional_privilege_target_types since
  # there are not other privilege types  that need to be set on this
  # model's roles
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alberich-0.2.0 test/dummy/app/models/child_resource.rb