Powered by Invision Power Board



Pages: (3) 1 2 [3]  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> [HOWTO] Acl/Auth user having multiple roles/groups, Extended Auth, simple solution
donutzeatpeopl
Posted: Oct 5 2010, 01:28 AM
Quote Post


Newbie
*

Group: Members
Posts: 2
Member No.: 2321
Joined: 4-October 10



Hey All,

First of all, thanks so much to Franck for putting this together. Great!

I'm a newbie to CakePHP and I'm strugging to put this together in CakePHP 1.3 . For the other beginners out there, I'm gonna be making a list here of things that definitely need to be changed (and updating it as I figure things out biggrin.gif ):
  • Put the file default.ctp into your app/views/elements (instead of app/views/layouts)
  • In that same default.ctp file, change "$content_for_layout" to "$message"
  • In /app/controllers/roles_controller.php and users_controller.php, you need to replace del() commands with delete()
  • In app/app_controller.php, you're going to need to define the SessionComponent and SessionHelper (From my reading, CakePHP 1.3 makes you define them explicitly... i.e. they are not automatically included anymore):
CODE

var $components      = array('Acl', 'AuthExt', 'RequestHandler', 'Session');
var $helpers         = array('Javascript', 'Html', 'Form', 'Session');

Also, just a general bit of advice (not a change from 1.2 to 1.3, just a reminder):
  • If you want to use the same database as is provided in the example, make sure that in app/config/core.php you are using the same Security.salt as was used by Franck (tutorial author). Otherwise, you won't be able to log in with username "admin" and password "admin".
Ok, that's it! The tutorial code seems now to be working with CakePHP 1.3 (1.3.4, to be exact)! I've attached my whole directory, including the CakePHP files for anyone who's interested.

Attached File ( Number of downloads: 157 )
Attached File  aclrole_CakePHP1_3_4_v2.zip
PMEmail Poster
Top
caketexan
Posted: Oct 9 2010, 03:35 AM
Quote Post


Member
**

Group: Members
Posts: 13
Member No.: 2282
Joined: 13-September 10



QUOTE (donutzeatpeopl @ Oct 5 2010, 01:28 AM)
Hey All,

First of all, thanks so much to Franck for putting this together. Great!

I'm a newbie to CakePHP and I'm strugging to put this together in CakePHP 1.3 . For the other beginners out there, I'm gonna be making a list here of things that definitely need to be changed (and updating it as I figure things out biggrin.gif ):
  • Put the file default.ctp into your app/views/elements (instead of app/views/layouts)
  • In that same default.ctp file, change "$content_for_layout" to "$message"
  • In /app/controllers/roles_controller.php and users_controller.php, you need to replace del() commands with delete()
  • In app/app_controller.php, you're going to need to define the SessionComponent and SessionHelper (From my reading, CakePHP 1.3 makes you define them explicitly... i.e. they are not automatically included anymore):
CODE

var $components      = array('Acl', 'AuthExt', 'RequestHandler', 'Session');
var $helpers         = array('Javascript', 'Html', 'Form', 'Session');

Also, just a general bit of advice (not a change from 1.2 to 1.3, just a reminder):
  • If you want to use the same database as is provided in the example, make sure that in app/config/core.php you are using the same Security.salt as was used by Franck (tutorial author). Otherwise, you won't be able to log in with username "admin" and password "admin".
Ok, that's it! The tutorial code seems now to be working with CakePHP 1.3 (1.3.4, to be exact)! I've attached my whole directory, including the CakePHP files for anyone who's interested.

i CAN NOT DOWNLOAD IT HERE...CAN YOU GIVE ME RIGHT LINK PLS
PMEmail Poster
Top
donutzeatpeopl
Posted: Oct 9 2010, 03:55 PM
Quote Post


Newbie
*

Group: Members
Posts: 2
Member No.: 2321
Joined: 4-October 10



I don't know what's going on with the attach feature of this message board, but to download:
  • Right click on the link to download -> "Save As"
  • Save the file to your computer. It may force you to save as .php or something.
  • Change the file extension to .zip (Example: yourFile.zip)
  • Unzip it.
PMEmail Poster
Top
caketexan
Posted: Oct 9 2010, 04:17 PM
Quote Post


Member
**

Group: Members
Posts: 13
Member No.: 2282
Joined: 13-September 10



QUOTE (donutzeatpeopl @ Oct 9 2010, 03:55 PM)
I don't know what's going on with the attach feature of this message board, but to download:
  • Right click on the link to download -> "Save As"
  • Save the file to your computer. It may force you to save as .php or something.
  • Change the file extension to .zip (Example: yourFile.zip)
  • Unzip it.

Hi I am able to d/l using IE with no problem and bypassed the step saving as .php and rename it to .zip....Firefox/chrome cant not
Thanks
PMEmail Poster
Top
_daemon_
Posted: Jan 1 2011, 06:31 PM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 2551
Joined: 1-January 11



Hi, this version for cakephp 1.3 is working but ajax acl allow/deny is not working. Any thoughts?
PMEmail Poster
Top
mfrday@hotmail.com
Posted: Feb 6 2011, 04:32 PM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 2678
Joined: 6-February 11



Hi there - This looks like a great component, but not sure if it can do what I need it to. I am a newbie, so bare with me..

We are writing an application for a school where students, teachers, and councellors will register. We will have the following roles: teacher, supporter, and admin. Here is the catch: When a teacher registers they are linked to their students. Not all students just theirs. For each of their own students they need the "teacher" permission. However, for the rest of the students they are assigned they are given "supporter" permission. In other words the teachers role varies based on the student. Any ideas how I would go about supporting this with your component ?

To simplify our needs even further, we essentially need a teacher to be able to login and select a student. The system will determine what role and permissions the teacher should have based on their relationship to the student.
PMEmail Poster
Top
ct_lat
Posted: Sep 1 2011, 07:04 AM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 3129
Joined: 1-September 11



To get Ajax to work add this to the acl.ctp on top of the file:
<?php echo $javascript->link('jquery.min', false); ?>
<?php echo $javascript->link('prototype', false); ?>
Also include the javascript files in webroot/js directory

This is not working for me in the component:
CODE
$paths      = $conf->controllerPaths;
$plugPaths  = $conf->pluginPaths;


Errors are:
CODE
Undefined property: Configure::$controllerPaths
Undefined property: Configure::$pluginPaths


Any suggestions for the above error? For now I just comment the lines.
PMEmail Poster
Top
binoyav
  Posted: Feb 1 2012, 10:12 AM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 516
Joined: 3-July 08



Will it work with my requirement given below
My tables

regions - values -> Global, sydney, newyork, paris, delhi etc

Roles table - values -> Administrator, Editor, User, Regional Admin, Regional Editor

join table - columns -> region_id, user_id, role_id

My requirement

Each role will have a set of permissions (actions). Users will be assigned to multiple regions. And will have a role for each. For ex:- user 'Tom' is assigned to region 'Sydney' with a role id 'Regional Editor'. So Tom can edit all content of sydney region. Also, if tom is assigned to some other region with role 'user', he can only view the items of that region. If the user is assigned to global region and given role as 'administrator' he can manage entire site.

Please help
PMEmail Poster
Top
templariod
Posted: Nov 5 2012, 11:41 PM
Quote Post


Newbie
*

Group: Members
Posts: 1
Member No.: 3662
Joined: 5-November 12



Hello. somebody can send me the aclrole.zip, I can't download
Thanks
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages: (3) 1 2 [3]  Reply to this topicStart new topicStart Poll

 

Disclaimer:
This forum is in no way affiliated with the Cake Software Foundation
The CakePHP name and icon is a trademark of the Cake Software Foundation


Lo-Fi Version