Re: Modeling an Employee/Company Hierarchy

2009-04-08 Thread Timothy Western

I have recently worked through a similar problem.  I'm building a site
to manage characters, and the organizational structure of a military
unit in a game I run in my spare time.   In my case i wanted to have
one table to store all of the organizational levels (I called them
divisions), with a type field that helped determine what level they
were at.  I then had a position table which stored the various
position names, and also linked them to a particular division and a
character.  Thus each character could have multiple positions, in
different divisions.

What I'm not sure about is whether this would work for your
situation.

You said you think the structure is like this Example: CEO --->
Directors > Managers ---> Individual
contributors.

If you don't have unit divisions within your unit, you could
substitute each position into the tree with a parent ID pointing up,
and then have a link table that would allow the individual to have or
report to many.

In my case, I was torn between putting the semantics of the Positions
into the Tree's at a level below their respective divisions, and then
only attaching characters there, but I really felt that was not a good
idea for my current project.  If an employee can serve multiple
positions and report to multiple people, it almost sounds like you
might need one table for the position -> Character relationship, and
another to store the character to multiple character/managers.   I
guess it depends on how much complexity you need.

Hope this gives you some ideas.

Tim

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: logout not authorized to access

2009-02-23 Thread Timothy Western

I thought it was not 'kosher' if you will to allow logout as that
would mess the Auth Component up (according to the Example in the
appendices anymore?  Is this now no longer the case?



On Feb 18, 4:46 am, Chris  wrote:
> I found the same thing.  I moved my login andlogoutfunctions to a
> security controller which handles other security based actions.
>
> You answered your own question as unfortunately even though Auth has a
> loginAction() method it doesnothave a logoutAction() method so it
> needs to be excluded manually.
>
> You can add a beforeFilter to the controller containing thelogout
> function like so:
>
> function beforeFilter() {
>         parent::beforeFilter();
>         $this->Auth->allow('logout');
>
> }
>
> That will ensure thatlogoutis ignored for all users.
>
> On Feb 10, 12:25 pm, yisn  wrote:
>
> > I followed the "Simple Acl controlled Application" in the Cookbook of
> > CakePHP, and got the message "You arenotauthorizedto access that
> > location" when try tologout. I logged in as a user who isnotallowed
> > to access the UsersController actions.
>
> > Do i need to grant the access to "logout" function for this user to
> > fix this problem? But the "login" function doesnotneed to be
> > granted, does the "auth" componentnotgrant access to "logout"
> > function itself?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Auth/ACL and redirect to home

2009-02-18 Thread Timothy Western

I am coming back to CakePHP after having given it a rest for a few
months, and am really enjoying the new features in 1.2.   I've gone
through and used Mark Story's fabulous auth and ACL tutorial, and have
it working pretty well, but there is one thing I'm not sure about.  I
know if you are on another page (you clicked somewhere that required
permissions and you were not authenticated or logged in), that it
redirects you to the login then back.  That's fine, but what I'm not
sure is how to handle the redirect when a user is coming from the
'home' page

I think I've got it figured out by setting my login redirect in
AppController to:

$this->Auth->loginRedirect = array('controller' => 'pages', 'action'
=> 'display', 'home');

However, I've noticed that sometimes I have to login twice before it
redirects.   Has anyone else experienced similar behavior?  Before I
made this change it seemed to work fine, and does on any page that
requires a login to get you ACL permissions.


Tim

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---