Auto-filtering EOF queries based on the current client
Auto-filtering EOF queries based on the current client
- Subject: Auto-filtering EOF queries based on the current client
- From: Sam Barnum <email@hidden>
- Date: Tue, 4 Sep 2007 11:08:04 -0700
I'm designing a WO app where multiple clients maintain their own
discreet sets of data. However, I'd like to keep everything in a
single database.
Certain entities are "global", meaning shared among all clients. A
good example would be a table containing status names for jobs. This
is the same for all clients.
Other entities are "compartmentalized", meaning once a user from
client A logs in, he can only fetch records which are linked to
client A (never from client B). A good example would be the
"project" entity.
Now the tricky part. I'd like to automate this filtering, so I don't
have to explicitly qualify "client=A" for every fetch against
Projects I do. Ideally, a user can use a D2W interface to do a
search for projects beginning with "P", and it will only return
results for his client.
My plan is to subclass EOEditingContext, and have it apply a custom
qualifier to any fetch against a "compartmentalized" entity. I'm
already using a subclass of EOEditingContext which keeps a reference
to the logged in user, for setting "modified by" flags
automatically. Almost all EOF activity uses this custom subclass
already.
Before I implement this, I was wondering if anyone else has any
suggestions on how to implement this, or an alternate approach, or
dire words of warning. I don't think I'm breaking any EOF
commandments here, but it still feels pretty invasive.
Thanks, all!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden