Mailinglist Archive: yast-commit (477 mails)

< Previous Next >
[yast-commit] rest-service : branch, master, updated.
  • From: git version control <git@xxxxxxxxxxxxxxxx>
  • Date: Mon, 29 Jun 2009 14:53:56 +0200
  • Message-id: <E1MLGMu-0001Ks-99@xxxxxxxxxxxxxxxx>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "YaST web service".

The branch, master has been updated
via 19108a5d93100f857cdde173f9b78148b34aaffa (commit)
via 847fc36d37bcbe584e0b164fb54d42a38a6f4958 (commit)
from 4a0d4cd07b0e68c9595c12b43c71a71642213434 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 19108a5d93100f857cdde173f9b78148b34aaffa
Merge: 847fc36d37bcbe584e0b164fb54d42a38a6f4958
4a0d4cd07b0e68c9595c12b43c71a71642213434
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Mon Jun 29 14:53:13 2009 +0200

Merge branch 'master' of git@xxxxxxxxxxxxxxxx:projects/yast/rest-service

commit 847fc36d37bcbe584e0b164fb54d42a38a6f4958
Author: Stefan Schubert <schubi@xxxxxxx>
Date: Mon Jun 29 14:52:53 2009 +0200

fixing setting permissions

-----------------------------------------------------------------------

Summary of changes and diff:
.../app/controllers/permissions_controller.rb | 30 ++++++++------------
1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/webservice/app/controllers/permissions_controller.rb
b/webservice/app/controllers/permissions_controller.rb
index d0a06a9..2983b26 100644
--- a/webservice/app/controllers/permissions_controller.rb
+++ b/webservice/app/controllers/permissions_controller.rb
@@ -121,34 +121,28 @@ class PermissionsController < ApplicationController
return render(:xml => permission, :location => "none")
end

- # PUT /permissions?user_id=<user_id>
- # PUT /permissions/<id>.xml?user_id=<user_id>
- # PUT /permissions/<id>.json?user_id=<user_id>
+ # PUT /permissions/<user_id>
+ # PUT /permissions/<user_id>.xml
+ # PUT /permissions/<user_id>.json

def update
unless permission_check( "org.opensuse.yast.permissions.write")
render ErrorResult.error(403, 1, "no permission") and return
end
- jsonFormat = false
- right = params[:id]
- if params[:id].end_with?(".json")
- jsonFormat = true
- right = params[:id].slice(0..-7)
- else
- right = params[:id].slice(0..-5) if params[:id].end_with?(".xml")
- end
- if ( not params[:permission].blank? )
- permission = Permission.new(right, params[:permission][:grant] )
- else
- permission = Permission.new
- end
- if params[:user_id].blank?
+ if params[:id].blank?
render ErrorResult.error(404, 1, "user not found") and return
end
- ret = Scr.instance.execute(["polkit-auth", "--user", params[:user_id],
permission.grant ? "--grant" : "--revoke",
"org.opensuse.yast.webservice.#{params[:id]}"])
+ jsonFormat = false
+ jsonFormat = true if params[:id].end_with?(".json")
+ if ( params[:permissions].blank? )
+ render ErrorResult.error(404, 1, "no permissions found") and return
+ end
+
+ ret = Scr.instance.execute(["polkit-auth", "--user",
params[:permissions][:id], params[:permissions][:grant] ? "--grant" :
"--revoke", params[:permissions][:name]])
if ret[:exit] != 0
render ErrorResult.error(404, 1, ret[:stderr]) and return
end
+ permission = Permission.new(params[:permissions][:name],
params[:permissions][:grant] )
return render(:json => permission.to_json, :location => "none") if
jsonFormat
return render(:xml => permission, :location => "none")



hooks/post-receive
--
YaST web service
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >