<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Roles Testing For Security</title>
	<atom:link href="http://www.pathf.com/blogs/2008/10/roles-testing-for-security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2008/10/roles-testing-for-security/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<lastBuildDate>Fri, 05 Mar 2010 19:33:43 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jo Hund</title>
		<link>http://www.pathf.com/blogs/2008/10/roles-testing-for-security/comment-page-1/#comment-3607</link>
		<dc:creator>Jo Hund</dc:creator>
		<pubDate>Sun, 12 Oct 2008 23:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1193#comment-3607</guid>
		<description>Hi,

I like your idea of using block helpers to limit access to certain parts of a view.

I describe an alternative approach to checking permissions at the ActiveRecord level in my post &lt;a href=&quot;http://clearcove.ca/blog/2008/08/recipe-restful-permissions-for-rails/&quot; rel=&quot;nofollow&quot;&gt;RestFul permissions in Rails&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I like your idea of using block helpers to limit access to certain parts of a view.</p>
<p>I describe an alternative approach to checking permissions at the ActiveRecord level in my post <a href="http://clearcove.ca/blog/2008/08/recipe-restful-permissions-for-rails/" rel="nofollow">RestFul permissions in Rails</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: grosser</title>
		<link>http://www.pathf.com/blogs/2008/10/roles-testing-for-security/comment-page-1/#comment-3596</link>
		<dc:creator>grosser</dc:creator>
		<pubDate>Sat, 11 Oct 2008 17:54:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1193#comment-3596</guid>
		<description>Nice and usable idea, but it can be even simpler and chainable too

def admin?
  current_user and current_user.admin?
end


if admin?
  xxx
end

Thing.create_from_params_if_user_can(current_user, params[:thing])

why should all things know about the user, let the user know what he can or cannot, so the knowledge is at one place(and mostly the logic is the same, so everything can be handled in an case statement)

Thing.create(params[:thing]) if current_user.can_create?(Thing)

and in the views, the new link is only shown if the user can create this thing

The idea is outlined here: http://pragmatig.wordpress.com/2008/06/29/separate-rights-management-from-controllers/
and some helpers that are based on this concept here: http://pragmatig.wordpress.com/2008/07/09/generic-smart-link_to_s-link_to_edit-link_to_destroy/</description>
		<content:encoded><![CDATA[<p>Nice and usable idea, but it can be even simpler and chainable too</p>
<p>def admin?<br />
  current_user and current_user.admin?<br />
end</p>
<p>if admin?<br />
  xxx<br />
end</p>
<p>Thing.create_from_params_if_user_can(current_user, params[:thing])</p>
<p>why should all things know about the user, let the user know what he can or cannot, so the knowledge is at one place(and mostly the logic is the same, so everything can be handled in an case statement)</p>
<p>Thing.create(params[:thing]) if current_user.can_create?(Thing)</p>
<p>and in the views, the new link is only shown if the user can create this thing</p>
<p>The idea is outlined here: <a href="http://pragmatig.wordpress.com/2008/06/29/separate-rights-management-from-controllers/" rel="nofollow">http://pragmatig.wordpress.com/2008/06/29/separate-rights-management-from-controllers/</a><br />
and some helpers that are based on this concept here: <a href="http://pragmatig.wordpress.com/2008/07/09/generic-smart-link_to_s-link_to_edit-link_to_destroy/" rel="nofollow">http://pragmatig.wordpress.com/2008/07/09/generic-smart-link_to_s-link_to_edit-link_to_destroy/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.240 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-16 21:06:00 -->
