On May 3, 6:12 am, Alberto Valverde <[EMAIL PROTECTED]> wrote:
> On May 3, 2007, at 11:38 AM, DarkBlue wrote:
>
>
>
>
>
> > Hello
>
> > installed the latest version and it works.
> > As mentioned in the changelog this exception was raised:
>
> >SecureResourcenow raises an AttributeError when norequireattribute
> > is present in the controller class or in the config file. Closes
> > #1336.
> > (Note: This might break some "broken" apps, fortunately a detailed
> > exception is raised advising how to fix it).
>
> > Here is the line where it was raised in the root controller:
>
> > bs =
> > SecureDataController
> > (sql_class=fadata,list_widget=fa_status_form,list_template='fa.templat
> > es.ports')
> > bs.require= identiy.in_group("suser")
>
> > above code worked before and my question is
> > how should it be written now ?
>
> Either declare "require" as a class attribute when subclassing:
>
> class SecureDataController(SecureResources):
> require= "foo"
>
> or bind it at construction time
>
> def __init__(self,require, ...):
> self.require=require
>
> Alberto
I have the following issue with the requirement of the require
attribute for subclasses of SecureResource:
class Root(controllers.RootController, identity.SecureResource):
require = identity.not_anonymous()
@expose('dvo.templates.selections')
def index(self):
...
@expose('dvo.templates.login')
def login(self, forward_url=None, previous_url=None, *args,
**kw):
...
I want to protect the index method, but I don't want to protect the
login method. Before, I could use specific identity decorators for
each method. But now, I need a way to turn off the require condition
set in the controller class for the login method.
How can I do this? Is there a way to specify a null require for a
specific method or the class?
If I don't turn this off for login, TG goes into an infinite loop
redirecting to the login method, but since the login method is
protected, redirecting, ...etc.
--Renier
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---