app/models/users/user.rb
# Returns the authorizations that this user has for the specified role in an array of UserUnitRoleAuthorization objects,
# or nil if the user does not have the role assigned.
Returns the authorizations that this user has for the specified role in an array of UserUnitRoleAuthorization objects,
or nil if the user does not have the role assigned.
Returns the authorizations that this user has for the specified role in an array of UserUnitRoleAuthorization objects or nil if the user does not have the role assigned .
def authorizations_for(role)
    auth_roles = roles.find(:all, :joins => :role, :include => :authorizations, :conditions => { "roles.name" => role.to_s })
    return nil if auth_roles.empty?
    auth_roles.collect(&:authorizations).flatten.compact
  end
def authorizations_for ( role ) auth_roles = roles . find ( :all , :joins => :role , :include => :authorizations , :conditions => { "roles.name" => role . to_s } ) return nil if auth_roles . empty? auth_roles . collect ( & :authorizations ) . flatten . compact end
Returns the authorizations that this user has for the specified role in an array of UserUnitRoleAuthorization objects,
or nil if the user does not have the role assigned.
Returns the authorizations that this user has for the specified role in an array of UserUnitRoleAuthorization objects or nil if the user does not have the role assigned .
role