From: Tony Mack Date: Thu, 8 Mar 2007 22:22:21 +0000 (+0000) Subject: - raise PLCPermissionDenied when a session auth'd api call fails due to role restrict... X-Git-Tag: PLCAPI-4.2-0~164 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a462d419bdbee8f792561593e7a7ea6200e5e800;p=plcapi.git - raise PLCPermissionDenied when a session auth'd api call fails due to role restrictions. Now users no longer lose their web session if they make a call without the appropriate role. --- diff --git a/PLC/Auth.py b/PLC/Auth.py index ecebb8a..627eece 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Auth.py,v 1.16 2007/02/05 19:20:38 tmack Exp $ +# $Id: Auth.py,v 1.17 2007/02/10 18:39:09 mlhuang Exp $ # import crypt @@ -147,7 +147,7 @@ class SessionAuth(Auth): person = persons[0] if not set(person['roles']).intersection(method.roles): - raise PLCAuthenticationFailure, "Not allowed to call method" + raise PLCPermissionDenied, "Not allowed to call method" method.caller = persons[0]