[Solar-talk] Added notes on working with Models/Records to thewiki
Kilbride, James P.
James.Kilbride at gd-ais.com
Wed Nov 14 08:30:33 CST 2007
Interesting. It does help. Now that we are getting a chance to actually
start using this and working out some of the questions that are arising
I am seeing more and more of this working out in interesting ways. I
think, at this point, the key barrier to usage of solar is
documentation. Perhaps I'll have some of my guys work on some of those
in the near future as well since that could be part of their sprints
during the development cycle. There is obviously a lot of 'implicit'
understanding of how these things work and a lot of times it looks like
it's based on things like RubyOnRails but I don't think we want to
depend on people understanding those structures in order to use or
understand solar.
So here's looking down the line a little bit Paul(or anyody else who's
become another Solar Master), but I'm not entirely sure I understand the
authorization model yet. Let's say I have a controller that has a
display method and a new/update method. I have two types of users,
viewers and editors. Should be obvious which ones can use what. I will,
in _setup, authenticate the users with my own authentication system and
will have a role for each of them, either 'viewer' or 'editor'. Is there
some way to set up the class so that the roles to actions relationship
is captured and all I'd have to do is something like say:
public function actionUpdate() {
if(Solar_**.authorized($role) {
//allow user
} else {
// punt user to standard
'yo-punk-you-don't-got-no-privileges-to-do-that-contact-admins-if-it's-w
rong' page.
}
}
or could I even do something like:
_setup() {
authClass.set('display', array('viewer','editor'));
authClass.set('update', array('editor));
authClass.user($role);
}
I think you get the basic idea of what I'm trying to get at. I'm
interesting in authorization rather than authentication. We have an
authentication method we have to use for compatibility across legacy
applications.
James Kilbride
-----Original Message-----
From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Paul M Jones
Sent: Wednesday, November 14, 2007 9:02 AM
To: solar-talk at lists.solarphp.com
Subject: Re: [Solar-talk] Added notes on working with Models/Records to
thewiki
On Nov 14, 2007, at 7:55 AM, Kilbride, James P. wrote:
> Do you have to define the columns of the table in the _setup for the
> magic fetchs to work or will it use reflection to do that?
Technically, you don't need to define $this->_table_cols at all --
Solar_Sql_Model inspects the database for those. The column defs are
used for creating the table, and for documenting the expected schema.
(At some point in the future we'll compare the defined columns with the
actual ones and raise notices if they don't match.)
The magic fetches do not look at the table cols; they just construct the
query and issue it.
Does that help at all?
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository for PHP5.
<http://solarphp.com>
Join the Solar community wiki! <http://solarphp.org>
Savant: The simple, elegant, and powerful solution for templates in PHP.
<http://phpsavant.com>
_______________________________________________
Solar-talk mailing list
Solar-talk at lists.solarphp.com
http://mailman-mail3.webfaction.com/listinfo/solar-talk
More information about the Solar-talk
mailing list