<?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: Extending sfGuardPlugin (part 2)</title>
	<atom:link href="http://www.symfonylab.com/extending-sfguardplugin-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.symfonylab.com/extending-sfguardplugin-part-2/</link>
	<description>Everything you wanted to know about Symfony framework but did not know who to ask!</description>
	<lastBuildDate>Wed, 14 Dec 2011 12:09:25 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jacques Philip</title>
		<link>http://www.symfonylab.com/extending-sfguardplugin-part-2/comment-page-1/#comment-309</link>
		<dc:creator>Jacques Philip</dc:creator>
		<pubDate>Mon, 24 Mar 2008 02:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.symfonylab.com/extending-sfguardplugin-part-2/#comment-309</guid>
		<description>I am working on an application where I extend sfGuard (or rather sfGuardDoctrine) to accommodate permissions per account.
I explain: There is a user table an account table, permission table and a ternary relationship in the permitting table with user_id, account_id and permission_id.
For example a certain user can have blog-admin permission for account 1.
The difficulty is that the credentials needed for an action cannot be set in security.yml because they dependent on the account the action acts on.
So what I do is:
- In the signin method of SecurityUser, I store the credential as a string of the form: permission&#124;account_id for example blog-admin&#124;1.
- I override the getCredential method of each module to protect, adding the account specific credentials (like blog-admin&#124;1) to the ones defined in the security.yml file.

Any other ideas if anyone has been implementing that case?</description>
		<content:encoded><![CDATA[<p>I am working on an application where I extend sfGuard (or rather sfGuardDoctrine) to accommodate permissions per account.<br />
I explain: There is a user table an account table, permission table and a ternary relationship in the permitting table with user_id, account_id and permission_id.<br />
For example a certain user can have blog-admin permission for account 1.<br />
The difficulty is that the credentials needed for an action cannot be set in security.yml because they dependent on the account the action acts on.<br />
So what I do is:<br />
- In the signin method of SecurityUser, I store the credential as a string of the form: permission|account_id for example blog-admin|1.<br />
- I override the getCredential method of each module to protect, adding the account specific credentials (like blog-admin|1) to the ones defined in the security.yml file.</p>
<p>Any other ideas if anyone has been implementing that case?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

