Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Connection, Query, Record
-
Labels:None
Description
Over the last several weeks I've been working on streamlining the access control logic in the application I'm working on, and I realized that Doctrine's event listeners might be able to help. For more detailed background information take a look at http://groups.google.com:80/group/dallasphp/browse_thread/thread/91e3f107cd611adf ...but here's the problem in a nutshell:
Since my application's access control logic is all implemented in PHP rather than in the database (i.e., I can't add access control to my queries as a simple WHERE clause), I'm looking for a way to hook into the query process just after the records have been hydrated and actually modify the result set that gets returned, such that only permissible records show up in the final result set.
Unfortunately, although there are several listener methods that look promising for this, none of them seem to have access to the data being returned. For instance, if I run a custom query via Doctrine_Query::execute(), the postQuery() hook definitely runs ...but it doesn't give me access to anything but the query string itself.
Since, in some instances (e.g., hydration listeners), the Doctrine_Event object is assigned arbitrary data that the listener can modify, I'm wondering if the same thing couldn't be done more universally?
Activity
| Field | Original Value | New Value |
|---|---|---|
| Summary | Event and record listeners should be able to modify result sets | Add pre/postHydrateResultSet() events |
| Affects Version/s | 1.2.0-BETA3 [ 10040 ] | |
| Issue Type | Improvement [ 4 ] | New Feature [ 2 ] |
| Fix Version/s | 1.3.0 [ 10042 ] |
| Fix Version/s | 1.2.2 [ 10047 ] | |
| Fix Version/s | 1.3.0 [ 10042 ] |
| Fix Version/s | 1.2.3 [ 10051 ] | |
| Fix Version/s | 1.2.2 [ 10047 ] |
| Fix Version/s | 1.2.3 [ 10051 ] |
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-280, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
In Doctrine 1.2 you can create custom hydrators. You can extend the core hydrators to remove the data you want? I think that would work.