RE: [Rainbowportal-devel] V2 Food For Thought
Brought to you by:
danijel_kecman,
manudea
From: William F. <WF...@im...> - 2005-01-24 01:45:53
|
Well, I'm working with a different set of objects in my new stuff, but the idea is the same. You should have 2 isinrole functions that is overloaded to take a string and an int, and then you should have isinroles functions that pass either an int array or a csv string or a list... but that function should just contain a loop that calls the isinrole function on each thing in the list. In the old code model the processing of this was sometimes pushed all the way back to the database and left up to the sprocs in sql to split the string and query based on it, but in my new model things are a lot cleaner. I suggest you do it as I stated above and figure out a way to cache the security roles information for objects/users in the current version as a stop gap while waiting for my stuff to be usable. =20 just split the string based on the , and then use the resulting array to loop thru and cast each split string to int. Where it is fetched/created is the question... anyone else have intimate knowledge of this? I am working on a different model and so I don't want to get too stuck into thinking in terms of the old one if you know what I mean. =20 I'd suggest maybe doing this after the stable release but before my version. Then it won't hold things up if it gets complex and it will be available sooner than the new stuff. I agree that the string check is not a good idea unless you lock down the database with cascading updates, etc... which may not be possible on some db's (once we get ported over to new stuff) so the code would become obsolete quickly if it is string based. The exception to this is the fact that I think the ms userroles thing may use strings in places, but I'm still digging into that. :) =20 Bill ________________________________ From: rai...@li... [mailto:rai...@li...] On Behalf Of Mike Stone Sent: Sunday, January 23, 2005 5:20 PM To: rai...@li... Subject: RE: [Rainbowportal-devel] V2 Food For Thought Ok, but I don't think you can pass the CheckBoxList or any other List for that mater as anything other then a String? =20 When I check 2 or more ID's will it not pass back 1,2,22,56,65... ? This would have to be passed as a string. So correct me if I am wrong but wouldn't I have to alter the IsInRole module to accept an int? IsInRoles call it so from within the IsInRoles method there would need to be an IF condition that checks to see if we have a numeric Role if so convert the string to int and call the IsInRole passing the int. else call IsInRole passing the string and let the overload do its thing.=20 =20 This part I think I can handle this in less then an hour, but the part that has me is how to get the users roles in ID# format. Should that be done at login time like it is now with the RoleName. I just have not been able to take time to figure out how, where, and when the User Roles are created.=20 =20 That and I need to have feed back from the group as to when this should be done? I know you (Bill) and the others are working very hard at getting this next version out soon, as most of the bugs have been cleaned out. I don't want to introduce more problems until this next major release is done. Maybe the group doesn't feel as I do that checking security with the string version is bad. I want to play will with others so I don't get kicked out of the sandbox :) =20 =20 Mike =20 =20 Mike Stone Director of Computer Information Services Kaskaskia College 27210 College Road Centralia, IL 62801 618-545-3201 www.kaskaskia.edu >>> WF...@im... 1/23/2005 17:54:50 >>> Just overload isinroles. This separate method nonsense is rampant throughout the portal and is beginning to annoy me. :) You can have two method bodies like this... Bool IsInRoles(string name) {} Bool IsInRoles(int id) {} -----Original Message----- From: rai...@li... [mailto:rai...@li...] On Behalf Of John Mandia Sent: Sunday, January 23, 2005 3:05 AM To: rai...@li... Subject: Re: [Rainbowportal-devel] V2 Food For Thought Hi Mike, I'd prefer the option of a seperate method to get the actual role id as there may be a lot of legacy code out there that expects the role name. Whether or not it goes into this release we can speak to the others and also vote on it via Jira (I think it has a voting feature). Since it is a new method it shouldn't break anything so I don't see the harm if it will help out module developers. John On Sun, 23 Jan 2005 02:19:50 -0600, Mike Stone <ms...@kc...> wrote: > Good Day! > =20 > I was working on a project that requires me to add security as stated=20 > in previous email. Anyway I have it working now, thanks to John Bowen. > =20 > What happens is the GetRoles returns a SQLDataReader, so I converted=20 > it to a DataTable so that it can be bound to the=20 > MultiSelectListDataType which is good, but I made a small assumption=20 > that Roles would have 2 columns RoleID and RoleName, and of course=20 > when I ran the first test it tried to match RoleID 19 to IsInRoles()=20 > and it could not find a match for 19, because it wants me to pass in=20 > "Jobs Administrator" which is the text value for the Role I selected. > Now next week when someone comes in and Changes the Role Name to "Jobs Admin" to shorten up the listing, my module will break. > because the ModuleSetting will still have the hold name. > =20 > SO I would like to offer we talk about the notion of changing this so=20 > that it does RoleID or at the very least either does both the RoleID=20 > and RoleName or has a separate method to check ids Say =20 > IsInRoles_ID(string strRoles) and IsInRoles(string strRoles) > =20 > Anyone have any feedback on this for VNext? or even fixing/upgrading=20 > 1.6 or 1.7? > =20 > Thanks > Mike > =20 > =20 > Mike Stone > Director of Computer Information Services Kaskaskia College 27210=20 > College Road Centralia, IL 62801 > 618-545-3201 > www.kaskaskia.edu ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Rainbowportal-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rainbowportal-devel ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Rainbowportal-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rainbowportal-devel |