comparison rhodecode/controllers/api/api.py @ 3168:2fb94c52e20e beta

whitespace cleanup
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 18 Jan 2013 01:05:23 +0100
parents 28571535dd61
children cd50d1b5f35b a50901f2108d
comparison
equal deleted inserted replaced
3167:87258a137018 3168:2fb94c52e20e
217 if HasPermissionAnyApi('hg.admin')(user=apiuser): 217 if HasPermissionAnyApi('hg.admin')(user=apiuser):
218 pass 218 pass
219 elif HasRepoPermissionAnyApi('repository.admin', 219 elif HasRepoPermissionAnyApi('repository.admin',
220 'repository.write')(user=apiuser, 220 'repository.write')(user=apiuser,
221 repo_name=repo.repo_name): 221 repo_name=repo.repo_name):
222 #make sure normal user does not pass someone else userid, 222 #make sure normal user does not pass someone else userid,
223 #he is not allowed to do that 223 #he is not allowed to do that
224 if not isinstance(userid, Optional) and userid != apiuser.user_id: 224 if not isinstance(userid, Optional) and userid != apiuser.user_id:
225 raise JSONRPCError( 225 raise JSONRPCError(
226 'userid is not the same as your user' 226 'userid is not the same as your user'
227 ) 227 )
268 268
269 :param apiuser: 269 :param apiuser:
270 :param userid: 270 :param userid:
271 """ 271 """
272 if HasPermissionAnyApi('hg.admin')(user=apiuser) is False: 272 if HasPermissionAnyApi('hg.admin')(user=apiuser) is False:
273 #make sure normal user does not pass someone else userid, 273 #make sure normal user does not pass someone else userid,
274 #he is not allowed to do that 274 #he is not allowed to do that
275 if not isinstance(userid, Optional) and userid != apiuser.user_id: 275 if not isinstance(userid, Optional) and userid != apiuser.user_id:
276 raise JSONRPCError( 276 raise JSONRPCError(
277 'userid is not the same as your user' 277 'userid is not the same as your user'
278 ) 278 )