Module: Arsecurity

Includes:
Rinterceptor
Included in:
ArsecurityDefault
Defined in:
lib/arsecurity.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

CREATE =
'create'
READ =
'read'
UPDATE =
'update'
DELETE =
'delete'

Instance Method Summary collapse

Instance Method Details

#rinter_create_around(invocation) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/arsecurity.rb', line 15

def rinter_create_around(invocation)
  if ArsecurityUtil.authorized?(CREATE, invocation.object.class.name, invocation.object, invocation)
    return invocation.invoke
  else
    raise ArsecurityNotAuthorizedException
  end
end

#rinter_delete_around(invocation) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/arsecurity.rb', line 22

def rinter_delete_around(invocation)
  if ArsecurityUtil.authorized?(DELETE, invocation.object.class.name, invocation.object, invocation)
    return invocation.invoke
  else
    raise ArsecurityNotAuthorizedException
  end
end

#rinter_update_around(invocation) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/arsecurity.rb', line 8

def rinter_update_around(invocation)
  if ArsecurityUtil.authorized?(UPDATE, invocation.object.class.name, invocation.object, invocation)
    return invocation.invoke
  else
    raise ArsecurityNotAuthorizedException
  end
end