Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] <rest-service> master : Allow session to be undefined
  • From: Klaus Kämpf <kkaempf@xxxxxxx>
  • Date: Mon, 6 Jul 2009 16:38:35 +0200
  • Message-id: <E1MNpL4-0007iV-3v@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 27bcb01f75ab213991b1c9159c2dada623a846d5
Author: Klaus Kämpf <kkaempf@xxxxxxx>
Date: Mon Jul 6 16:38:35 2009 +0200

Allow session to be undefined
---
webservice/lib/yast_roles.rb | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/webservice/lib/yast_roles.rb b/webservice/lib/yast_roles.rb
index 7cf1cf8..20b6b3f 100644
--- a/webservice/lib/yast_roles.rb
+++ b/webservice/lib/yast_roles.rb
@@ -27,7 +27,7 @@ public
return true
end
#checking roles
- roles = session['user_roles'] ? session['services'] :
user_roles(self.current_account.login)
+ roles = (defined?(session) && session && session['user_roles']) ?
session['services'] : user_roles(self.current_account.login)
roles.each do |role|
if ( role != self.current_account.login and
polkit_check( action, role) == :yes)
@@ -39,7 +39,7 @@ public
return false
rescue Exception => e
Rails.logger.error "permission_check() exception: #{$!}"
- Rails.logger.debug $@.join("\n")
+# Rails.logger.debug $@.join("\n")
return false
end
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages