RE: RE: Limiting EOGenericRecord Relationship with a Session Value?
RE: RE: Limiting EOGenericRecord Relationship with a Session Value?
- Subject: RE: RE: Limiting EOGenericRecord Relationship with a Session Value?
- From: "Paul Mathews" <email@hidden>
- Date: Wed, 26 Nov 2003 10:22:04 +1100
- Organization: Cubespace Pty Ltd
Thanks to you all, that is a better way of thinking about it, and I will
go down that path.
Originally I wanted to allow all kinds of access, but I found it too
much to think about and tackle the technology at the same time.
The plan was to have a type of inherited access model, but as said I was
not sure how to go about it.
It was along the lines of:
Building <-has a->> Floor <-has a->> Room
I wanted to allow the security for the Person to be set at any level and
in three states Allow, Inherit Access, Disallow.
So a Person could be set to have Access to Building, and if nothing else
is set (for Floor and Room) the access would be grated to all
Floors and Rooms. Alternatively Access could be granted to a Building,
but Denied for certain rooms or floors, or access to a Floor only
would allow access to the Building and the Rooms on that Floor...etc
If anyone would like to comment a EO model to satisfy that type of
thing, it would help me out a lot.
I find the front end sorts itself out, once these issues are solved
(properly - which is not always the case in my case!)
That is what I find so great about WO.
Thanks to all of you that sent a reply
Paul Mathews
---------------------------------------------
email@hidden
Find product information @ http://www.cubespace.com.au
-----Original Message-----
From: Jim Pearson [mailto:email@hidden]
Sent: Wednesday, November 26, 2003 3:06 AM
To: Paul Mathews; email@hidden
Subject: Re: Limiting EOGenericRecord Relationship with a Session Value?
Paul,
If you set the model up such that:
A Building has Persons;
and
A Person has Rooms;
Then, you would select a Building in the workflow and pick or search for
a Person related to the Building. The second repitition could then point
something like currentPerson.rooms for the item list and currentRoom in
the repetition item.
The relationship from Building to Room is important (perhaps) for other
parts of the application, but not for showing a building's person's
rooms.
HTH
jimp
-----Original Message-----
From: Paul Mathews <email@hidden>
Sent: Nov 25, 2003 10:27 AM
To: email@hidden
Subject: Limiting EOGenericRecord Relationship with a Session Value?
Hi all
I was hoping for some advice, being somewhat new to webobjects.
I have a model that is in the form
Building <--->> Room
^ ^
| |
v v
v v
Person_Building Person_Room
^ ^
^ ^
| |
-- > Person <----
Basically a there are many buildings with many rooms in each. A Person
can be
granted access to a Building and a limit number of rooms within the
building.
No in displaying this I was using a Repetition to display the Buldings
in a
list and setting the masterObject to the Person logged in. The Person
object
is kept in the Session object.
The problem is when I use a second repetition to display the Rooms for
the
build (well that part is easy) but to limit the list of room to the
Person
that is logged in is where I am comming apart.
1. Is there a better way to structure this model ?
2 I have tried adding a custom routine to the Building.java class
module. The
problem there if I try and access the session().PersionID() routine it
complains about session being unknown. The routine is as follows...
public class Building extends EOGenericRecord {
...
/** @TypeInfo Room */
public NSArray myRooms() {
NSMutableDictionary d = new NSMutableDictionary();
-> // Session s = (Session) session(); !!! Error !!!
-> d.takeValueForKey(s.PersonID, "personName");
d.takeValueForKey(this.roomName(), "roomName");
EOModelGroup mg = EOModelGroup.defaultGroup();
EOFetchSpecification fs =
mg.fetchSpecificationNamed("myrooms","Room");
fs = fs.fetchSpecificationWithQualifierBindings(d);
EOEditingContext ec = this.editingContext();
return (NSArray)ec.objectsWithFetchSpecification(fs);
}
...
I know know that session() can not be used in a EOGenericRecord, so I
was
wondering if anyone has any other ideas?
Thanks all
These things are hard to describe in a short message, so if more info is
needed just hammer me with it.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.