Recess Developer Forums: A better description of Annotations? - Recess Developer Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

A better description of Annotations? The book barely scratches the surface, and leaves questions unanswered

#21 User is offline   KrisJordan Icon

  • Administrator
  • Icon
  • Group: Administrators
  • Posts: 78
  • Joined: 25-August 09
  • LocationNorth Carolina, USA

Posted 05 October 2009 - 01:20 PM

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.
0

#22 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

Posted 08 October 2009 - 08:59 PM

eh... I have a way... not as graceful, kind of manual, but oh well...

I will be posting progress soon, as soon as I get Git working... grumble...
0

#23 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

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?
0

#24 User is offline   Thomaz Icon

  • Group: Members
  • Posts: 39
  • Joined: 28-August 09
  • LocationHeemskerk, The Netherlands

Posted 24 November 2009 - 04:07 AM

I found something at http://www.recessfra...l/ch06s06.html:

// 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
0

#25 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

Posted 24 November 2009 - 07:11 AM

Yeah, I actually found that in the book. The Wrappable Methods section complements the Annotations section very nicely, but I think they need to more obviously reference and connect themselves... I might have at making some edits to the book here soon...
0

#26 User is offline   beline Icon

  • Group: Members
  • Posts: 36
  • Joined: 02-September 09
  • LocationMaine, USA

Posted 24 November 2009 - 07:14 AM

More specifically though, this is one that confuses me:
        $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! :) So i'll likely answer my own question this morning or so...
0

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users