<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Extending sfGuardPlugin (part 2)</title>
	<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>
	<pubDate>Fri, 08 Aug 2008 20:50:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Jacques Philip</title>
		<link>http://www.symfonylab.com/extending-sfguardplugin-part-2/#comment-309</link>
		<dc:creator>Jacques Philip</dc:creator>
		<pubDate>Mon, 24 Mar 2008 02:47:29 +0000</pubDate>
		<guid>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>
