Class: Granted::Granter

Inherits:
Object
  • Object
show all
Defined in:
lib/granted/granter.rb

Instance Method Summary collapse

Constructor Details

#initializeGranter

Returns a new instance of Granter.



3
4
# File 'lib/granted/granter.rb', line 3

def initialize
end

Instance Method Details

#from(grantee) ⇒ Object



10
11
12
# File 'lib/granted/granter.rb', line 10

def from(grantee)
  accept(grantee: grantee)
end

#grantObject



26
27
28
# File 'lib/granted/granter.rb', line 26

def grant
  accept(action: :grant)
end

#on(subject) ⇒ Object



14
15
16
# File 'lib/granted/granter.rb', line 14

def on(subject)
  accept(subject: subject)
end

#revokeObject



30
31
32
# File 'lib/granted/granter.rb', line 30

def revoke
  accept(action: :revoke)
end

#right(right) ⇒ Object



22
23
24
# File 'lib/granted/granter.rb', line 22

def right(right)
  rights(right)
end

#rights(*rights) ⇒ Object



18
19
20
# File 'lib/granted/granter.rb', line 18

def rights(*rights)
  accept(rights: [rights].flatten)
end

#to(grantee) ⇒ Object



6
7
8
# File 'lib/granted/granter.rb', line 6

def to(grantee)
  accept(grantee: grantee)
end