add scopes to deleteAll
Posted 28 October 2011 - 02:02 PM
why findAll apply scopes, and deleteAll not?
dafenetly a needed feature
Yii Framework Demos
Common Yii Questions
Demo Blog Search with Zend_Lucene
Yii "registry" | Understanding the layout->view randering flow
Shrink Yii | Caching config/main.php | CPhpAuthManager - how it works, and when to use it
Theme Picker | Language Picker (i18n)
Posted 31 October 2011 - 11:25 AM
I use defaultScope frequently to force some filter on data based on user privileges. Such approach allows me to ensure that user won't see any data it is not allowed for him, but when I saw this thread (and issue log) - I realized that such user CAN delete or update ANY record...
I think it is a bug in fact, because developer can still use scopes in code:
and framework should follow this scope, or shoul yell about deleting record when inner criteria object not being empty (at least warning in log) or it can lead to unpredictable behavior...
What is the concept behind this approach and ignoring scopes on update/delete and why Qiang selected "it won't be fixed"?
Posted 18 April 2012 - 11:16 AM