﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Role Based Security  » Filling a BO by a permission key</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:03:10 GMT</lastBuildDate><ttl>20</ttl><item><title>Filling a BO by a permission key</title><link>http://forum.strataframe.net/FindPost8792.aspx</link><description>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:&lt;br&gt;
[codesnippet]&lt;br&gt;
For Each LocationRow As DataRow In loLocations.CurrentDataTable.Rows&lt;br&gt;
   For Each CMrow As DataRow In Me.CurrentDataTable.Rows&lt;br&gt;
      If SecurityBasics.CurrentUser.GetPermission(LocationRow("RBSPermissionKey").ToString).Action = PermissionAction.Deny Then&lt;br&gt;
&lt;br&gt;
         If LocationRow("LocationID").Equals(CMrow("LocationID")) Then&lt;br&gt;
            MessageBox.Show("removing " &amp; LocationRow("LocationName").ToString)&lt;br&gt;
            CMrow.Delete()&lt;br&gt;
         End If&lt;br&gt;
      End If&lt;br&gt;
   Next&lt;br&gt;
Next&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
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.</description><pubDate>Tue, 15 May 2007 10:12:47 GMT</pubDate><dc:creator>rmoore</dc:creator></item><item><title>RE: Filling a BO by a permission key</title><link>http://forum.strataframe.net/FindPost8805.aspx</link><description>Glad to help :)</description><pubDate>Tue, 15 May 2007 10:12:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Filling a BO by a permission key</title><link>http://forum.strataframe.net/FindPost8803.aspx</link><description>Ok.  That makes more sense to me now.  Thanks for the info!</description><pubDate>Tue, 15 May 2007 10:06:14 GMT</pubDate><dc:creator>rmoore</dc:creator></item><item><title>RE: Filling a BO by a permission key</title><link>http://forum.strataframe.net/FindPost8800.aspx</link><description>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.&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://forum.strataframe.net/Uploads/Images/e97a679c-0e21-4e82-9704-941c.png"&gt;&lt;/P&gt;&lt;P&gt;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:&lt;/P&gt;&lt;P&gt;[codesnippet]MyBO.CurrentDataTable.AcceptChanges()[/codesnippet]</description><pubDate>Tue, 15 May 2007 09:40:50 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>