On Sat, Nov 22, 2008 at 2:33 PM, Gustavo Narea <[EMAIL PROTECTED]> wrote: > > Hello. > > The functionality provided by SecureController in quickstarted projects is > already provided by TG2 controllers by default, so why is it still there? > > I think it's best to remove it so that: > 1.- It'll be easier to implement (no need to subclass an special class). > 2.- It wouldn't have to be maintained by those who make TG2 apps. If > something must change, everybody will have to update their code.
Yes we can! :) But should we? The whole thing as been thought this way from the beginning (when I did not know where we were headed). Mark orientated me in the direction of just looking for a check_security callable present on the controller. I don't find easier to write the whole check_security in my application. If you remove the SecureController I feel that most people will end up with a SecureController in their code sort of... What is important is to have the check_security attr on your controller class and that this attr is a callable returning True or False. But why remove code that people would need to rewrite if we remove it? Anyone who wants for any reason to write a controller that does not subclass SecureController can just implement the check_security by themselves but this is a bit of code which is not that pretty and that you would need to define as a function somewhere and then stuff into your controllers to be secured. I feel subclassing from SC makes your code more explicit and clean but as already said you can already do other wise really easily without removing the SecureController implementation. It's just that SC will fit 99% of the common need and should nearly never need to evolve appart from the error reporting that we should stuff in there before the final version (tg.flash). Florent. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
