<?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: How to write a permission system using bits and bitwise operations in PHP</title>
	<atom:link href="http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/feed" rel="self" type="application/rss+xml" />
	<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 07:31:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: tahir</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-2015</link>
		<dc:creator>tahir</dc:creator>
		<pubDate>Thu, 26 May 2011 10:06:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-2015</guid>
		<description>Thanks for the quick repoly.

Infact i wanted to design a customized security module which can work on fields level. meaning every field in my application can have enable/diable/visible flags that can be configured for each user/group.

The idea is to use same technique (bitwise operators) which will eliminate defining hundereds of fields in my database and i will only define a few integer values for each user and screen combination.

I have tried to simulate the same with the provided example, it worked but the real problem now is the 32 bit nature of Int in C# cannot possibly go beyond 32 fields at most.

Any better thoughts for moving forward.</description>
		<content:encoded><![CDATA[<p>Thanks for the quick repoly.</p>
<p>Infact i wanted to design a customized security module which can work on fields level. meaning every field in my application can have enable/diable/visible flags that can be configured for each user/group.</p>
<p>The idea is to use same technique (bitwise operators) which will eliminate defining hundereds of fields in my database and i will only define a few integer values for each user and screen combination.</p>
<p>I have tried to simulate the same with the provided example, it worked but the real problem now is the 32 bit nature of Int in C# cannot possibly go beyond 32 fields at most.</p>
<p>Any better thoughts for moving forward.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-2014</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Wed, 25 May 2011 16:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-2014</guid>
		<description>I&#039;m not exactly understanding your question but if you mean what I think you mean then yes...</description>
		<content:encoded><![CDATA[<p>I&#8217;m not exactly understanding your question but if you mean what I think you mean then yes&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tahir</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-2012</link>
		<dc:creator>tahir</dc:creator>
		<pubDate>Wed, 25 May 2011 08:40:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-2012</guid>
		<description>Thanks for the great article.
Can we use the similar approach to design the field/object level security and plug this with the customized security manager ?</description>
		<content:encoded><![CDATA[<p>Thanks for the great article.<br />
Can we use the similar approach to design the field/object level security and plug this with the customized security manager ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-357</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Fri, 14 Aug 2009 20:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-357</guid>
		<description>Do you mean keeping permissions in a database so you are not hard coding it?!

If that&#039;s what you mean, it&#039;s OK to do it that way in situations where you need it otherwise you should always keep it simple...

Of course, permissions for each individual user should be kept in the database.</description>
		<content:encoded><![CDATA[<p>Do you mean keeping permissions in a database so you are not hard coding it?!</p>
<p>If that&#8217;s what you mean, it&#8217;s OK to do it that way in situations where you need it otherwise you should always keep it simple&#8230;</p>
<p>Of course, permissions for each individual user should be kept in the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kétszeri Csaba</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-356</link>
		<dc:creator>Kétszeri Csaba</dc:creator>
		<pubDate>Fri, 14 Aug 2009 14:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-356</guid>
		<description>Fist of all it is a great example page to demonstrate the use of bitwise operators, but... implementing the example permission system this way is not as much flexible as it couud be in sql

users (userid PK, etc...)
permissiontypes (permid PK, etc)
user_permission(userid FK, permissiontype FK)

You would have much easier code on the long rin and implementing the mentioned group (role) based authentication is a breeze.

And yes, of course it is way better to wrap it with a permission class if you ever have to use a standard user/permission repository for example by LDAP.</description>
		<content:encoded><![CDATA[<p>Fist of all it is a great example page to demonstrate the use of bitwise operators, but&#8230; implementing the example permission system this way is not as much flexible as it couud be in sql</p>
<p>users (userid PK, etc&#8230;)<br />
permissiontypes (permid PK, etc)<br />
user_permission(userid FK, permissiontype FK)</p>
<p>You would have much easier code on the long rin and implementing the mentioned group (role) based authentication is a breeze.</p>
<p>And yes, of course it is way better to wrap it with a permission class if you ever have to use a standard user/permission repository for example by LDAP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mendi</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-355</link>
		<dc:creator>Mendi</dc:creator>
		<pubDate>Tue, 04 Aug 2009 14:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-355</guid>
		<description>Thanks! This is a great help for me!! Good job!</description>
		<content:encoded><![CDATA[<p>Thanks! This is a great help for me!! Good job!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-354</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Thu, 30 Jul 2009 21:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-354</guid>
		<description>If you have to track more that 32 permissions then you could have permission groups I guess...</description>
		<content:encoded><![CDATA[<p>If you have to track more that 32 permissions then you could have permission groups I guess&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-353</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 30 Jul 2009 10:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-353</guid>
		<description>I understand that..
I asked it because I want to write a ACL class of my own.
And bitwise is the easiest solution in this case. The bit limit is something I don&#039;t like though</description>
		<content:encoded><![CDATA[<p>I understand that..<br />
I asked it because I want to write a ACL class of my own.<br />
And bitwise is the easiest solution in this case. The bit limit is something I don&#8217;t like though</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codehead</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-352</link>
		<dc:creator>Codehead</dc:creator>
		<pubDate>Wed, 29 Jul 2009 20:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-352</guid>
		<description>Yes, that is technically correct, so you could have permission groups maybe...

I would assume 32 bits though, since you don&#039;t know where your code is going to run.</description>
		<content:encoded><![CDATA[<p>Yes, that is technically correct, so you could have permission groups maybe&#8230;</p>
<p>I would assume 32 bits though, since you don&#8217;t know where your code is going to run.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://codingrecipes.com/how-to-write-a-permission-system-using-bits-and-bitwise-operations-in-php/comment-page-1#comment-351</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Wed, 29 Jul 2009 20:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.code-head.com/?p=685#comment-351</guid>
		<description>Nice article, but does it mean that if you fix it this way, that you can only have 32 rights on a 32bit system and 64 rights on a 64bit system?

Or does it work in another way?</description>
		<content:encoded><![CDATA[<p>Nice article, but does it mean that if you fix it this way, that you can only have 32 rights on a 32bit system and 64 rights on a 64bit system?</p>
<p>Or does it work in another way?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

