Ok I think I see what you're getting at their James,

This would be a combination of the two solutions? Using the normalization in
the database with a linking table that joins my users to the entitlements,
which was the same I had with the array but instead of populating the array,
simply build the structure with the entitlements which are 'true' and then
assume everything else is false, interesting.

This would obviously have the benefit of not having to loop a conditional on
the array to check for entitlement, and also keep a fairly tidy database, I
like it.

*scurries off into the back room where the sound of drills, saws and hammers
can be heard.

Rob

-----Original Message-----
From: James Holmes [mailto:[EMAIL PROTECTED] 
Sent: 24 May 2007 12:16
To: CF-Talk
Subject: Re: Granular Security Model

This could be normalised so that there is a user table, an enlitlement
table and an m:n joining table between them (user_entitlement or
similar). This way only a true (1) is indicated in the DB and you can
assume false for everything else (inlcuding when initialising the
struct in CF).


On 5/24/07, Robert Rawlins - Think Blue wrote:

> The structs method work nicely from a ColdFusion point of view, but I felt
> the database was a little untidy as you had a separate database column for
> each 'entitlement' which was set to 0 or 1 dependant on the permissions,
> each user then had a row in this table. This was then stored in the struct
> as key/value pairs with each entitlement having its one struct element and
a
> 'true' or 'false' value, you can then do something like <cfif
> Session.User.Entitlements.DeleteUser> to check if the user has that
> permission.

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279051
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to