Re: ACL Component GOOD Tutorial, anyone?

2010-02-09 Thread Zaky Katalan-Ezra
I think you are mixing up two thinks.
Don't let users access adm area' = ACL - accessing resources
nor other users area = Not classic ACL it's more permissions issue -
accessing data.

for example:
The annual report is a resource that can be watched by managers but not by
regular employee.
You restrict this by ACL.
But, if you want the manager to see the  annual report with his employees
data only you need to filter the data from the annual report table, at the
model of course.

In your case everyone can see posts but while looping the messages for
redndering you should add Edit buttons next to posts that has the author
as the logged user or admin.
Needless to say, you should check it again in the model and in the database
if possible




On Mon, Feb 8, 2010 at 11:41 PM, Guillermo Mansilla mansil...@gmail.comwrote:


 http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1
 On 8 February 2010 17:08, Guillermo Mansilla mansil...@gmail.com wrote:

 http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1


 On 8 February 2010 16:19, Fernando Z. Bob fzmas...@gmail.com wrote:

 I am already having the same problem [?]

 Lot of tutorials, lot of knowledge but nothing that really explain
 everything about that.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en



  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
361.gif

Re: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Blackbit
Take a look at this tutorial and read part III:
http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake2/index.html

On 8 Feb., 17:31, Renato de Freitas Freire renat...@gmail.com wrote:
 Hi!

 Im trying to understand this ACL tutorial by Cakebook, but its absolutely
 incomplete.
 Can anyone tell me where I can find a good acl tutorial? Good and
 understandable.

 I need to build a login system based on groups and users permissions, but I
 need to know how to handle owners information.
 Like blog tutorial, only the owner or admin can edit a post, or change user
 information, etc.
 Others users can only see the post.
 How to change password, automaticaly add users and permissions, password
 recovery, control access (dont let users access adm area nor other users
 area), etc.

 Please, can anyone help me? Im a little lost here.

 Tnx!

 --
 Renato de Freitas Freire
 ren...@morfer.org

 On Sun, Feb 7, 2010 at 10:45 PM, mansil...@gmail.com 
 mansil...@gmail.comwrote:

  When isAuthorized() returns false I get redirected to /  which then
  redirects to pages controller...

  Here is my code:

  App_controller:

  class AppController extends Controller {

    var $components = array('Auth', 'Session');

    var $helpers = array('Javascript', 'Html', 'Form', 'Ajax',
  'Session');

    function beforeFilter() {

       $this-Auth-authorize = 'controller';

       $this-Auth-userModel = 'Member';

       Security::setHash(md5);

       $this-Auth-fields = array('username' = 'email', 'password' =
  'password');

       $this-Auth-loginAction = array('controller' = 'members',
  'action' = 'add');

       $this-Auth-loginRedirect = array('controller' = 'members',
  'action' = 'myaccount');

       $this-Auth-logoutRedirect = array('controller' = 'members',
  'action' = 'login');

       $this-Auth-autoRedirect = false;

    }

  }

  and here is my members controller:

  function isAuthorized(){
                 switch ($this-action) {
                         case index:
                                 return ($this-Auth-user('rol') ==
  'admin');
                         break;
                         default:
                                 return true;
                 }
         }
         /* function that handles the login*/
         function login(){
                 if($this-Auth-login()){
                         if($this-Auth-user('rol') == 'member'){ #check if
  it is a member
  or an admin
                                 $this-redirect('myaccount');
                         }elseif ($this-Auth-user('rol' == 'admin')) {
                                 $this-redirect('index');
                         }

                 }
         }

  I have tried changing all properties of Auth in app_controller with no
  results, it always redirects to /
   I just want to redirect to the login page or maybe just show a
  message.

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  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.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Guillermo Mansilla
So far no one have helped me out...

On 8 February 2010 12:30, Blackbit i...@tetrafuck.com wrote:

 Take a look at this tutorial and read part III:

 http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake2/index.html

 On 8 Feb., 17:31, Renato de Freitas Freire renat...@gmail.com wrote:
  Hi!
 
  Im trying to understand this ACL tutorial by Cakebook, but its absolutely
  incomplete.
  Can anyone tell me where I can find a good acl tutorial? Good and
  understandable.
 
  I need to build a login system based on groups and users permissions, but
 I
  need to know how to handle owners information.
  Like blog tutorial, only the owner or admin can edit a post, or change
 user
  information, etc.
  Others users can only see the post.
  How to change password, automaticaly add users and permissions, password
  recovery, control access (dont let users access adm area nor other users
  area), etc.
 
  Please, can anyone help me? Im a little lost here.
 
  Tnx!
 
  --
  Renato de Freitas Freire
  ren...@morfer.org
 
  On Sun, Feb 7, 2010 at 10:45 PM, mansil...@gmail.com 
 mansil...@gmail.comwrote:
 
   When isAuthorized() returns false I get redirected to /  which then
   redirects to pages controller...
 
   Here is my code:
 
   App_controller:
 
   class AppController extends Controller {
 
 var $components = array('Auth', 'Session');
 
 var $helpers = array('Javascript', 'Html', 'Form', 'Ajax',
   'Session');
 
 function beforeFilter() {
 
$this-Auth-authorize = 'controller';
 
$this-Auth-userModel = 'Member';
 
Security::setHash(md5);
 
$this-Auth-fields = array('username' = 'email', 'password' =
   'password');
 
$this-Auth-loginAction = array('controller' = 'members',
   'action' = 'add');
 
$this-Auth-loginRedirect = array('controller' = 'members',
   'action' = 'myaccount');
 
$this-Auth-logoutRedirect = array('controller' = 'members',
   'action' = 'login');
 
$this-Auth-autoRedirect = false;
 
 }
 
   }
 
   and here is my members controller:
 
   function isAuthorized(){
  switch ($this-action) {
  case index:
  return ($this-Auth-user('rol') ==
   'admin');
  break;
  default:
  return true;
  }
  }
  /* function that handles the login*/
  function login(){
  if($this-Auth-login()){
  if($this-Auth-user('rol') == 'member'){ #check
 if
   it is a member
   or an admin
  $this-redirect('myaccount');
  }elseif ($this-Auth-user('rol' == 'admin')) {
  $this-redirect('index');
  }
 
  }
  }
 
   I have tried changing all properties of Auth in app_controller with no
   results, it always redirects to /
I just want to redirect to the login page or maybe just show a
   message.
 
   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
 others
   with their CakePHP related questions.
 
   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.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.comcake-php%252bunsubscr...@googlegroups.comFor
 more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Nabil Alsharif
There aren't any good tutorials, I've looked, they are all vague or
missing a point or two. Unfortunately what your gonna have to do is read
a couple of the tutorials and then try to do it your self.

On Mon, 2010-02-08 at 13:46 -0430, Guillermo Mansilla wrote:
 So far no one have helped me out...
 
 On 8 February 2010 12:30, Blackbit i...@tetrafuck.com wrote:
 Take a look at this tutorial and read part III:
 
 http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake2/index.html
 
 On 8 Feb., 17:31, Renato de Freitas Freire
 renat...@gmail.com wrote:
  Hi!
 
  Im trying to understand this ACL tutorial by Cakebook, but
 its absolutely
  incomplete.
  Can anyone tell me where I can find a good acl tutorial?
 Good and
  understandable.
 
  I need to build a login system based on groups and users
 permissions, but I
  need to know how to handle owners information.
  Like blog tutorial, only the owner or admin can edit a post,
 or change user
  information, etc.
  Others users can only see the post.
  How to change password, automaticaly add users and
 permissions, password
  recovery, control access (dont let users access adm area nor
 other users
  area), etc.
 
  Please, can anyone help me? Im a little lost here.
 
  Tnx!
 
  --
  Renato de Freitas Freire
  ren...@morfer.org
 
  On Sun, Feb 7, 2010 at 10:45 PM, mansil...@gmail.com
 mansil...@gmail.comwrote:
 
   When isAuthorized() returns false I get redirected to /
  which then
   redirects to pages controller...
 
   Here is my code:
 
   App_controller:
 
   class AppController extends Controller {
 
 var $components = array('Auth', 'Session');
 
 var $helpers = array('Javascript', 'Html', 'Form',
 'Ajax',
   'Session');
 
 function beforeFilter() {
 
$this-Auth-authorize = 'controller';
 
$this-Auth-userModel = 'Member';
 
Security::setHash(md5);
 
$this-Auth-fields = array('username' = 'email',
 'password' =
   'password');
 
$this-Auth-loginAction = array('controller' =
 'members',
   'action' = 'add');
 
$this-Auth-loginRedirect = array('controller' =
 'members',
   'action' = 'myaccount');
 
$this-Auth-logoutRedirect = array('controller' =
 'members',
   'action' = 'login');
 
$this-Auth-autoRedirect = false;
 
 }
 
   }
 
   and here is my members controller:
 
   function isAuthorized(){
  switch ($this-action) {
  case index:
  return
 ($this-Auth-user('rol') ==
   'admin');
  break;
  default:
  return true;
  }
  }
  /* function that handles the login*/
  function login(){
  if($this-Auth-login()){
  if($this-Auth-user('rol') ==
 'member'){ #check if
   it is a member
   or an admin
  
  $this-redirect('myaccount');
  }elseif ($this-Auth-user('rol' ==
 'admin')) {
  $this-redirect('index');
  }
 
  }
  }
 
   I have tried changing all properties of Auth in
 app_controller with no
   results, it always redirects to /
I just want to redirect to the login page or maybe just
 show a
   message.
 
   Check out the new CakePHP Questions
 sitehttp://cakeqs.organd help others
   with their CakePHP related questions.
 
   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.comcake-php%
 2bunsubscr...@googlegroups.comFor more options, visit this
 group at
  http://groups.google.com/group/cake-php?hl=en
 
 Check out the new CakePHP Questions site http://cakeqs.org and

Re: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Fernando Z. Bob
I am already having the same problem [?]

Lot of tutorials, lot of knowledge but nothing that really explain
everything about that.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
361.gif

Re: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Guillermo Mansilla
http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1

On 8 February 2010 16:19, Fernando Z. Bob fzmas...@gmail.com wrote:

 I am already having the same problem [?]

 Lot of tutorials, lot of knowledge but nothing that really explain
 everything about that.

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
361.gif

Re: ACL Component GOOD Tutorial, anyone?

2010-02-08 Thread Guillermo Mansilla
http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1
On 8 February 2010 17:08, Guillermo Mansilla mansil...@gmail.com wrote:

 http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1


 On 8 February 2010 16:19, Fernando Z. Bob fzmas...@gmail.com wrote:

 I am already having the same problem [?]

 Lot of tutorials, lot of knowledge but nothing that really explain
 everything about that.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
361.gif