On 9/8/05, Dave Howorth <[EMAIL PROTECTED]> wrote: > Peter Speltz wrote: > > Had a thought about actions that don't have a model class . Currrently > > this does not handle them the docs say. However I bet it could . It > > might need some tweaks of the sql. But really no model class is a > > value for model_class. It could be represented by an empty string or > > NULL in the permissions table. Ill try it sometime. > > Hi Peter, > > I'm not sure why you'd want this? If you do need it, you could just pass > an empty string as the second (entity) argument to authorize(). Or > better yet some other string - 'no_model', say. Empty strings and NULL > values tend to be error prone and generate special cases in code, IMHO :) > > Cheers, Dave >
Emmm, for authorizing pages that don't have a model class. :) Like plain templates.., actions in the Driver. Here is the line from the docs that i'm referingi to: "authenticate" needs to deal with requests with no model class before calling this method because the response is application-specific. Why is the response application specific? It does not have to be. Does not Maypole always just look for a plain template in the template paths? I'll have to check exact details of what Maypole does but in my book a path like this; localhost/beerdb/Tips would have an action of "Tips" and no model class. It just occurred to me last night, that there is no reason i cannnot store a permission for this page in permissions. auth_role model_action model_class ------------ ------------------ ----------------- user Tips NULL Then like you say use $r->authorize($r, undef) ; Now as far as what to store in the DB for an inexistent model class, I always thought NULL was safe because DBI treats perl's undef value to NULL in the DB. I'll just have to play with it. Anyway i am happy to find i can use authorize and set permissions for plain templates. thanks ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Maypole-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maypole-users
