English 中文(简体)
如何改进面包店的维修部分,以使用用户类型?
原标题:how to improve cakephp auth component to use user type?
  • 时间:2010-01-15 11:43:28
  •  标签:
  • cakephp

i 在我的面包所项目中使用 au网

我在用户Mysql表格中添加类型

(a) 行政、客户

i 有必要将行政工作转向CP网页,客户可进入其简介网页,而且只能使用一名主计长。

不使用《维也纳条约法公约》或任何其他与此相关的文书

最佳回答

d 我建议利用你在控制器或模型中能够增加的教益功能。 Set the AuthComponent:authorize ={ Controller dell } to choose which You想要使用。

接着,你写了“Authorized”(Authorized)”功能,即每份行动在 au/not的回报。 如果你愿意,你也可以做一些逐级检查。

现在,如果你只是想把一个行政改用在标识/名称的正确网页上,那么,你就可以在“Filter”方法上添加代码(或者在某个特定的控制器中,或者在“控制器”。 在这一点上,仅仅检查一下,看看看看看看看看看看看看该信规定的行政价值是否与用户的行政价值相同(将由AusthComponent在届会数据中储存,可查得的是该数字;Auth->User())。 然后,适当前往行政/非行政区。

问题回答

isAuthorized() is the best choice. i would recommend to separate the users from their groups in the database, so User habtm Group... but It is not a problem if user belongs to one and only one group I do not recommend ACL for non record-level-based permissions system

只注意一点,但除非最近发生了一些变化 PHP不支持ENUM类。

Your best bet is a Group model ( groups mysql table ) and a group_id field on the users table. Then you can $hasOne = array( Group ); in your User model.

从那以后,你可以通过“CakePHP Auth”用户小组的简单直观搜索,跟踪Austh部件的一组出入控制辅导。





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签