Module: Granted::ForGranted

Extended by:
ActiveSupport::Concern
Defined in:
lib/granted/modules/for_granted.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#grant(*rights) ⇒ Object



8
9
10
11
12
13
# File 'lib/granted/modules/for_granted.rb', line 8

def grant(*rights)
  Granted::Granter.new
                  .grant
                  .rights(rights)
                  .on(self)
end

#revoke(*rights) ⇒ Object



15
16
17
18
19
20
# File 'lib/granted/modules/for_granted.rb', line 15

def revoke(*rights)
  Granted::Granter.new
                  .revoke
                  .rights(rights)
                  .on(self)
end