Great questions.
Rather than trying to generate permissions during the expand step your best bet is probably to iterate over your controller classes, reflect on them, and pull out the RequiresPermissionAnnotations from their class/method annotations. The best example of this is how routes work. Recess polls each application asking for Routes and caches the result in production mode.
A better description of Annotations? The book barely scratches the surface, and leaves questions unanswered
#23
Posted 23 November 2009 - 08:07 PM
Ok, so time has marched on, and I am actually working on some things now, but have a few more questions:
Is it possible to return more than one type for isFor()?
Also, is there documentation somewhere regarding all possible parameters? Or do we have to dig through the code to find them?
Is it possible to return more than one type for isFor()?
Also, is there documentation somewhere regarding all possible parameters? Or do we have to dig through the code to find them?
#24
Posted 24 November 2009 - 04:07 AM
I found something at http://www.recessfra...l/ch06s06.html:
Perhaps you should take look at the Annotation class for all the FOR_* items and see what types are available.
// Only valid on classes
function isFor() { return Annotation::FOR_CLASS; }
// Valid on methods or properties
function isFor() { return Annotation::FOR_METHOD | Annotation::FOR_PROPERTY; }
Perhaps you should take look at the Annotation class for all the FOR_* items and see what types are available.
Hoppa
#26
Posted 24 November 2009 - 07:14 AM
More specifically though, this is one that confuses me:
and what are the other things you can do in validate?
Actually, I'm not really asking, as I have actually figured out quite a bit over the past day or so and LIBERAL use of PRINT_R()... HA!
So i'll likely answer my own question this morning or so...
$this->validOnSubclassesOf($class, Controller::CLASSNAME);and what are the other things you can do in validate?
Actually, I'm not really asking, as I have actually figured out quite a bit over the past day or so and LIBERAL use of PRINT_R()... HA!

Sign In
Register
Help

MultiQuote