<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Restricting access to retrieved data - How?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : Restricting access to retrieved data - How?</description>
  <pubDate>Tue, 28 Apr 2026 05:01:06 -700</pubDate>
  <lastBuildDate>Sat, 04 Apr 2009 21:09:36 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=1189</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Restricting access to retrieved data - How? : The Thread.CurrentPrincipal should...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4301#4301</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 04-Apr-2009 at 9:09pm<br /><br /><P>The Thread.CurrentPrincipal should be set for the CurrentThread by the time CreateQuery is called.&nbsp; If you've implemented the IEntityLoginManager interface you can determine the concrete type of that&nbsp;IPrincipal.</P><DIV>If we had a good workaround to the OnFetching problem I would have told you by now.&nbsp;&nbsp;If you know how to build and manipulate expression trees, you can actually use OnFetching to modify the query.&nbsp; And that's all we've got until early May.</DIV><P>&nbsp;</P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Sat, 04 Apr 2009 21:09:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4301#4301</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : One flaw in this plan;there is...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4296#4296</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 04-Apr-2009 at 3:43pm<br /><br />One flaw in this plan;there is no HttpContext available to find the currently logged in user in the DF webservice, so I can't see any way of deriving the currently logged in user (either DF identity or the ASP.NET logged-in user).<br>Can you suggest either a way of retrieving this, or (better still) a workaround for the <font color="#0000ff">OnFetching</font> problem I listed above?<br><br>Unfortunately, waiting until sometime in May to see what happens isn't a practical option for us.<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Sat, 04 Apr 2009 15:43:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4296#4296</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : As a quick prologue, the following...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4288#4288</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 04-Apr-2009 at 12:38am<br /><br />As a quick prologue, the following (with very brief testing) seems to address the issue:<br><font color="#0000ff"><br>&nbsp;&nbsp;&nbsp; public partial class iRiskEntities : global::System.Data.Objects.ObjectContext<br>&nbsp;&nbsp;&nbsp; {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public new ObjectQuery&lt;T&gt; CreateQuery&lt;T&gt;(string qry, params ObjectParameter&#091;&#093; parameters)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (typeof(T) == typeof(Portfolio))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjectQuery&lt;Portfolio&gt; oq = (ObjectQuery&lt;Portfolio&gt;)base.CreateQuery&lt;Portfolio&gt;(qry, parameters).Where(pf =&gt; pf.Client.ClientID == 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return oq as ObjectQuery&lt;T&gt;;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return base.CreateQuery&lt;T&gt;(qry, parameters);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }</font><br><br>It's a little crude, but I can't see any other means that maintains the flexibility of allowing client queries unless all client functions go via views with built-in filtering, and even then all updates and deletes would need to be protected via triggers, and the SQL server would need to know the current user's identity.<br><br>Cheers,<br>&nbsp; Jason<br>]]>
   </description>
   <pubDate>Sat, 04 Apr 2009 00:38:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4288#4288</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : I understand that the entire Linq...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4287#4287</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 04-Apr-2009 at 12:15am<br /><br />I understand that the entire Linq expression is passed, and the security risk here is that somebody is easily able to modify the client to remove the Where clause, returning every Product, whether we intended them to have access or not.<br><br>If we have a wholesaler system we might have the clause:<br>_mgr.Products.Where(p=&gt; p.Id == 1 &amp;&amp; p.WholesalerId == mywholesalerid)<br><br>The client executing the query may be logged in as Wholesaler #123, so the query the client sends out will be:<br><font color="#0000ff">_mgr.Products.Where(p=&gt; p.Id == 1 &amp;&amp; p.WholesalerId == 123)</font><br><br>Now if I hack the client I can change this to<br><font color="#0000ff">_mgr.Products.Where(p=&gt; p.Id == 1 &amp;&amp; p.WholesalerId == 321)</font><br>giving another client's records.<br><br>The solution is to use security at the server end to record the wholesalerID, and ensure every response sent is *always* filtered by wholesaler, effectively giving the currently connected client a projection of the database that only shows their data, giving a hacked server-side query of:<br><font color="#0000ff">_mgr.Products.Where((p=&gt; p.Id == 1 &amp;&amp; p.WholesalerId == 321) </font><font color="#0000ff">&amp;&amp; p.WholesalerId == 123</font><font color="#0000ff">)</font><br><br>As you say, adding a Filter property to IEntityServerFetching's EntityFetchingEventArgs would presumably modify the Linq expression to add the specified clause.<br>My code might then be something like this (all ficticious, but you get the idea)<br><br><font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void OnFetching(object sender, EntityFetchingEventArgs e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (e.Query.ReturnType == typeof(Product))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int wholesalerid = GetWhilesalerId(HttpContext.Current.User.Identity.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iRisk.DataModel.iRiskEntities de = new iRisk.DataModel.iRiskEntities();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Query.Filter = new Filter(p =&gt; p.Wholesaler.WholesalerID == wholesalerid);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><br><br>In Linq2SQL you can easily override the accessors for the very bottom level collection, so even a complex join will have each low-level table filtered correctly, effectively allowing automatic server-side changing of<br>Customers Join Orders Join Items<br>to <br>(Customers where xxx) join (Orders where yyy) join (Items where zzz)<br><br>My (failed) attempt was as follows:<br><font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void OnFetching(EntityServerFetchingEventArgs args)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (args.Query.ReturnType == typeof(Portfolio))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string uname = args.Principal.Identity.Name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; args.Query = (args.Query as EntityQuery&lt;Portfolio&gt;).Include("Client").Where(p =&gt; p.Client.ClientID == 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><br><br>Unfortunately this breaks when the system tries to load child entities:<br>{value(IdeaBlade.EntityModel.v4.EntityGroupProxy`1&#091;DomainModel.Portfolio&#093;).Where(t =&gt; (t.PortfolioId = 1)).OfType().SelectMany(t =&gt; t.Securities)}<br>:&gt;<br>Expression of type 'System.Linq.IQueryable`1&#091;DomainModel.Security&#093;' cannot be used for parameter of type 'System.Linq.IQueryable`1&#091;DomainModel.Portfolio&#093;' of method 'System.Linq.IQueryable`1&#091;DomainModel.Portfolio&#093; Where&#091;Portfolio&#093;(System.Linq.IQueryable`1&#091;DomainModel.Portfolio&#093;, System.Linq.Expressions.Expression`1&#091;System.Func`2&#091;DomainModel.Portfolio,System.Boolean&#093;&#093;)'<br><br>I seem to be almost there by overriding the CreateQuery of the ADO.Net Entity provider:<br><br><font color="#0000ff">&nbsp;&nbsp;&nbsp; public partial class iRiskEntities : global::System.Data.Objects.ObjectContext<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public new ObjectQuery&lt;T&gt; CreateQuery&lt;T&gt;(string qry, params ObjectParameter&#091;&#093; parameters)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug.WriteLine("&gt;&gt;&gt;&gt;&gt;" + qry);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //if (typeof(T) == typeof(Portfolio))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp; ObjectQuery&lt;T&gt; oq = base.CreateQuery&lt;T&gt;(qry, parameters);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp; oq = from pf in oq where ((Portfolio)pf).Client.ClientID == 1) select pf;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp; return (ObjectQuery&lt;T&gt;)oq;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return base.CreateQuery&lt;T&gt;(qry, parameters);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }</font><br><br>Again, it's just the modification of the ObjectQuery that has me stumped.<br><br>I'll experiment with the InvokeServerMethod tonight, and possibly subject you to further questions tomorrow :)<br><br>I think the questions I'm asking are not unusual, and the dilema all .NET developers face nowadays is that you frequently have no idea whether you're using a product as the developers intended, or if you've completely missed the point in the 2,800 object definitions and interfaces in a suppliers object model :)<br>The abundance of "auto-generated documentation" (also known as "crap") is stifling, so I was very impressed with your extensive PDF manuals, and this is one aspect that attracted me to DF, so keep up the good work, and can I suggest that you release one soon with real-world example of security, both at basic role and row level, and include some nice demos of integration with MVVM approaches.<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Sat, 04 Apr 2009 00:15:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4287#4287</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : Additional server-side operations...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4284#4284</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 10:42pm<br /><br />Additional server-side operations can be added using the InvokeServerMethod(Async) call on the EntityManager.&nbsp;&nbsp; <DIV>&nbsp;</DIV><DIV>As an addendum to the above post, in DevForce you choose where you want the query to execute - against the server or cache (or both)&nbsp;- via the QueryStrategy.&nbsp; So you could of course load all entities of a certain type into cache, and then execute LINQ queries locally to filter that data.</DIV><DIV>&nbsp;</DIV><DIV>You might want to give your account rep a call next week to discuss your concerns or schedule a talk with an architect.</DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 22:42:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4284#4284</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : One possible point of confusion...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4283#4283</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 10:26pm<br /><br /><P>One possible point of confusion which I'd like to clear up.&nbsp; In DevForce the entire LINQ expression (of any complexity) is sent to and executed on the server, and only the results of that query are returned to the client.&nbsp; So for example, a query like the following:</P><DIV>&nbsp; _mgr.Products.Where(p=&gt; p.Id == 1)</DIV><DIV>&nbsp;</DIV><DIV>means that a similar SQL query is sent to the database, and only the single retrieved entity is returned to the Silverlight client.&nbsp; The filtering is not performed on the client after the data is returned.&nbsp; This also means that application logic can build queries which restrict each query&nbsp;by user or tenant or similar so that only the requested data is shipped across the wire:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp; _mgr.UserInfo.Where(u=&gt; u.Owner.ClientId == currentUser.ClientId)</DIV><DIV>&nbsp;</DIV><DIV>The new filtering capability of IEntityServerFetching is intended to allow a developer to take an existing query from the client, with any number of clauses, and easily append additional criteria on the server immediately prior to query execution.&nbsp; </DIV>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 22:26:22 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4283#4283</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : OK, that clarifies things.Role...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4282#4282</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 10:22pm<br /><br />OK, that clarifies things.<br>Role based restrictions via attributes have limited use as it can only apply at column level, and row level is by far the most important, so we assumed that would be available. Allowing client-side joining and querying is a fantastic feature, but it has to work against filtered sets of data. WebServices obviously resolve this by adding their own Where clauses, but the link of ADO EF through to DF appears very hard-linked, so is there a practical workaround in the short term? I don't want to 'assume' a forthcoming solution to security in our product, as security is a core feature and not something to be retro-fitted.<br><br>It sounds as though calling this version RC1 may misleading, as you need to add fundamental functionality to make it usable in real-world scenarios, so this is a real disappointment to us.&nbsp; As our planned delivery is at the same time as SL3's release we're stuck choosing a suitable EF provider, so we have to make a call on who we believe will supply a complete working solution that we can base our system on.<br><br>The system DevForce uses is very nice indeed, the method of sharing source for entities is a clean and efficient, and functions such as caching entities are brilliant.&nbsp; We would much rather use this product than Ria, but are concerned that we appear to have hit major obstacles in the first few days, so I'm really looking for some positive arguments to say why and how we should stick with DF for our systems.<br>For example, you mention that modifying the query in the IEntityServerFetching.OnFetching is not simple, but I would like to know if it is possible, and if so, how?&nbsp; Using MS Ria is often overly complex, so implementing a workaround for a couple of issues like this in DF is no sweat.<br>Also, Is it feasible to add custom functionality to the webservice used by DF so the client can execute other functions without creating additional WCF services? e.g. Add an "ActivateSurvey(Guid)" function that is not a stored procedure?<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 22:22:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4282#4282</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : DevForce does not give unrestricted...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4281#4281</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 4:33pm<br /><br /><DIV>DevForce does not give unrestricted access to every row in every table, it leaves determination of access restrictions to the application.&nbsp; The current security support in DevForce allows the application to determine how (and whether) users should be authenticated and what authorization they should receive.&nbsp; It's true that this support needs further enhancement, and in the next Release Candidate query filtering on the server will be provided.&nbsp; We are also looking at providing attribute-based security access similar to that provided in RIA, and other server events and interfaces which may help here.</DIV><DIV>&nbsp;</DIV><DIV>At this time, with Release Candidate 1, your options in restricting access are unfortunately limited.</DIV><DIV>&nbsp;</DIV><DIV>We welcome any constructive feedback on this, or other features you see which are either lacking or insufficient for your needs.</DIV>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 16:33:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4281#4281</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : Hi,I&amp;#039;m not quite sure I&amp;#039;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4278#4278</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 3:43pm<br /><br />Hi,<br>I'm not quite sure I'm clear on that workaround.&nbsp; Are you saying that I should filter the user's access permissions at the client end??<br>The idea of a security restriction is that the client is never sent any other users records, so adding 'where record.owner.clientid=thisuser.id' at the client end would be crazy.<br>Does this mean that the system currently gives unrestricted read access to rows in every published table to every remote client?<br>Is there any way a middle-layer can be introduced to modify these accesses, such as subclassing the ADO.NET EF to insert a filter layer?<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 15:43:17 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4278#4278</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? :  Currently, there really isn&amp;#039;t...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4274#4274</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 12:14pm<br /><br /><DIV><DIV>Currently, there really isn't an easy way to intercept queries and filter based on user permissions.&nbsp;&nbsp;The IEntityQuery is passed into&nbsp;OnFetching, and you're right it's not easy to manipulate the query.&nbsp; In the May RC we will add a Filter property to the query to make it easy to append filtering logic on the server.&nbsp; An IPrincipal for the current user is also passed to&nbsp;OnFetching and is available to other interface implementations and events as well.&nbsp; You can use the Principal.IsInRole method to test the user's permissions.&nbsp;&nbsp; As a workaround for current limitations, adding the filter on the client at the time the query is&nbsp;built/run is probably the best approach.</DIV><DIV>&nbsp;</DIV><DIV>As for how Login works - first, there's currently no tie-in to ASP.NET authorization services.&nbsp; You can implement the IEntityLoginManager interface on the server.&nbsp; The interface&nbsp;has a single method, Login, which is provided with a credential passed from the client in the client's call to EntityManager.LoginAsync().&nbsp;&nbsp; Your Login implementation is responsible for taking that credential and validating as needed, and returning an IPrincipal of some sort.&nbsp; That IPrincipal is then used on both client and server for all subsequent requests.&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>It looks like we don't have a&nbsp;sample of this in our Silverlight or WinClient documentation or learning units, but we can provide one upon&nbsp;request.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV></DIV><DIV>&nbsp;</DIV><DIV></DIV><DIV></DIV><P><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp; </DIV><DIV>&nbsp;</DIV></P>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 12:14:40 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4274#4274</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : OK, perhaps it&amp;#039;s time to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4259#4259</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 7:22am<br /><br />OK, perhaps it's time to go back to Linq2QL.&nbsp; I can't find any way of addressing this issue, it's holding us up, I know it's possible in RIA because we have a working version, and I'm tired of wading through PDF files.<br>Then again, perhaps I'm just p*ssed off because I've spent two days trying to do this in DF and have had no assistance in the forum! Argh!<br><br>I'll have one last look tomorrow then I'll call it a day.<br><br>Jason<br>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 07:22:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4259#4259</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : Ah, I finally got it to work by...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4255#4255</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 03-Apr-2009 at 5:51am<br /><br />Ah, I finally got it to work by adding it to the namespaces to the correct parts of the Web.config file.<br>Unfortunately, this doesn't appear to do what I hoped, as it receives the full query rather than the base entity collection being accessed.<br>Should I be doing this restriction in IdeaBlade at all, should I modify the underlying EDM, or is there another approach?<br><br>Cheers,<br>&nbsp;Jason<br>]]>
   </description>
   <pubDate>Fri, 03 Apr 2009 05:51:47 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4255#4255</guid>
  </item> 
  <item>
   <title>Restricting access to retrieved data - How? : Originally posted by smi-mark ...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4249#4249</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=485" rel="nofollow">jsobell</a><br /><strong>Subject:</strong> 1189<br /><strong>Posted:</strong> 02-Apr-2009 at 5:32pm<br /><br />&#091;Copied in from the Winforms EF forum:&#093;<br><br><strong><em>Originally posted by smi-mark</em></strong><em></em><br><br>            &nbsp;&nbsp;&nbsp;&nbsp; public class BOSFetch : IEntityServerFetching<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void OnFetching(IdeaBlade.EntityModel.v4.EntityServerFetchingEventArgs args)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (args.Query.QueryableType is ActiveEntity) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //In here you can cast the args.Query to an EntityQuery&lt;ActiveEntity&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //and then you are able to do .Where and all your other query functions.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>I assume it's added tomy Thingy.Web project, but it appears to have no effect there. Howwould it every get picked up? Does it go in an entity's partial class?<br><br>I'm interested in intercepting all client requests and filtering them based on our own per-entity permission set.<br>In Linq to SQL or Ria we would simply add a '.Where' to the .GetClients, but what would be the correct manner in DF?<br>Ionly installed this yesterday, so please explain in simple terms, andassume that I have not read the manual (which I have scanned throughseveral times but not found a solution).<br>Also, how on earth does the Login feature work? How do I verify the login info?<br>Ifyou could point me to any relevant doco that would be great, but thevideos on the site are all covering pretty fundamental stuff, so themore technical customers could probably use a few more advanced ones :)<br>I'm using the SL version, just in case that makes a difference, and it looks excellent. <br><br>Cheers,<br>&nbsp;Jason]]>
   </description>
   <pubDate>Thu, 02 Apr 2009 17:32:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1189&amp;PID=4249#4249</guid>
  </item> 
 </channel>
</rss>