StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Filling a BO by a permission keyExpand / Collapse
Author
Message
Posted 05/15/2007 7:51:22 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 06/25/2007 3:10:17 PM
Posts: 21, Visits: 84
I have two business objects, LocationsBO and CreditMemosBO. I fill the LocationsBO by a permission key. If the permission is deny I remove the row from the current datatable. Once this LocationsBO is filled, I have all the locations a user has access to. What I want to do is to be able to fill the CreditMemosBO by the LocationIDs that are in the LocationsBO (CreditMemosBO has a foreign key LocationID). I was thinking of using this:

For Each LocationRow As DataRow In loLocations.CurrentDataTable.Rows
For Each CMrow As DataRow In Me.CurrentDataTable.Rows
If SecurityBasics.CurrentUser.GetPermission(LocationRow("RBSPermissionKey").ToString).Action = PermissionAction.Deny Then

If LocationRow("LocationID").Equals(CMrow("LocationID")) Then
MessageBox.Show("removing " & LocationRow("LocationName").ToString)
CMrow.Delete()
End If
End If
Next
Next


but it doesn't work. Is there a better way of filling a second BO based on permissions of a different BO? I could put a permission key in the CreditMemosBO but I don't want the extra overhead of inserting a permission key when a record is added.
Post #8792
Posted 05/15/2007 9:40:50 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:04:58 PM
Posts: 4,780, Visits: 4,744
Well I am a little confused as to what you are trying to accomplish...but one thing to keep in mind is that a BO already has an Adding key, which is going to be far less overhead that what I understand you to be doing now.  If you open up a BO in the component designer (double-click the BO) and go to the AddSecurityKey and set the Add to have the permission you are needing to check on.

Obvioulsy you can cycle through and remove any records, but if you do not want them to be persisted back to the database as "Deleted" be sure to call the AcceptChanges() method on the CurrentDataTable after you delete the records, otherwise if you call the Save it will think those records need to be deleted on the server:

MyBO.CurrentDataTable.AcceptChanges()
Post #8800
Posted 05/15/2007 10:06:14 AM
StrataFrame Beginner

StrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame BeginnerStrataFrame Beginner

Group: StrataFrame Users
Last Login: 06/25/2007 3:10:17 PM
Posts: 21, Visits: 84
Ok. That makes more sense to me now. Thanks for the info!
Post #8803
Posted 05/15/2007 10:12:47 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:04:58 PM
Posts: 4,780, Visits: 4,744
Glad to help
Post #8805
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 5:34am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.