|
i want any controller not to be able to access(read or write) a certain field in the model
how can i accomplish that -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
it is usually not the controller you need to worry about
in the view level just dont output the variable and on input (forms etc) use whitelisting for the model methods to exclude the field on save etc. Am Montag, 30. Juli 2012 16:34:59 UTC+2 schrieb Mahmoud Adel Farid: i want any controller not to be able to access(read or write) a certain field in the model Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
well i am worried about controller so no other team member can directly change some fields , i need to encapsulate some fields
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
if you can't trust your co-workers, you might want to change the company.
PS: they could still go into the database directly to alter values (or do you also cipher the database.php?) in any case the above hints should get you started on how to address the problem. Am Mittwoch, 1. August 2012 10:37:29 UTC+2 schrieb Mahmoud Adel Farid: well i am worried about controller so no other team member can directly change some fields , i need to encapsulate some fields Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
In reply to this post by Mahmoud Adel Farid
You can use the model callbacks for that, the beforesave one, see:
On Wednesday, August 1, 2012 10:37:29 AM UTC+2, Mahmoud Adel Farid wrote: well i am worried about controller so no other team member can directly change some fields , i need to encapsulate some fields Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
it boils down to either
- use security component (form fields cannot be messed with) - or use whitelisting (fieldList) on save: http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-save-array-data-null-boolean-validate-true-array-fieldlist-array Am Mittwoch, 1. August 2012 11:09:21 UTC+2 schrieb Crazy: You can use the model callbacks for that, the beforesave one, see: Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
In reply to this post by euromark (munich)
@euromarks & @Crazy
-- thanks @euromarks it is not a trust issue it is matter of good programming practice that is what encapsulation originally made for (correct me if i am wrong) Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
| Powered by Nabble | Edit this page |
