Class: BloggingLicense

Inherits:
License::Base show all
Defined in:
lib/generators/cancan/licenses/templates/blogging_license.rb

Instance Attribute Summary

Attributes inherited from License::Base

#licenses, #permit

Instance Method Summary collapse

Methods inherited from License::Base

#can, #cannot, #load_rules, #owns

Constructor Details

#initialize(name) ⇒ BloggingLicense

Returns a new instance of BloggingLicense.



2
3
4
# File 'lib/generators/cancan/licenses/templates/blogging_license.rb', line 2

def initialize name
  super
end

Instance Method Details

#enforce!Object



6
7
8
9
10
# File 'lib/generators/cancan/licenses/templates/blogging_license.rb', line 6

def enforce!
  can(:read, Blog)
  can(:create, Post)
  owns(user, Post)
end