Class: Role

Inherits:
Object
  • Object
show all
Defined in:
model/security.rb

Instance Method Summary collapse

Instance Method Details

#add_auth_to(auth) ⇒ Object



50
51
52
53
# File 'model/security.rb', line 50

def add_auth_to(auth)
  pr=AuthorizationsRole[role_id:self[:id], authorization_id:auth[:id]]
  AuthorizationsRole.insert(role_id:self[:id], authorization_id:auth[:id]) unless pr
end

#deleteObject



45
46
47
48
# File 'model/security.rb', line 45

def delete
  AuthorizationsRole.where(:role_id=>self[:id]).delete
  super
end

#include_authorization?(auth) ⇒ Boolean

Returns:

  • (Boolean)


37
38
39
40
41
42
43
# File 'model/security.rb', line 37

def include_authorization?(auth)
  ##$log.info("POR BUSCAR:#{authorization}")
  ##$log.info(authorizations)
  authorizations.any? {|v|
  ##$log.info(v[:id]);
   v[:id]==auth}
end