Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C3F1A1337B80 for ; Sun, 21 Nov 2010 11:36:45 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 98374-05 for ; Sun, 21 Nov 2010 15:36:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.39]) by mail.postgresql.org (Postfix) with ESMTP id 3F15B1337B5E for ; Sun, 21 Nov 2010 11:36:37 -0400 (AST) Received: (qmail 29623 invoked from network); 21 Nov 2010 15:36:36 -0000 Received: from 25-76-42-72.skybeam.com (HELO [192.168.2.16]) (scott_ribe@killerbytes.com@[72.42.76.25]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with AES128-SHA encrypted SMTP for ; 21 Nov 2010 15:36:36 -0000 Subject: Re: implement BLP model on Postgresql db Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Scott Ribe In-Reply-To: <398458.12164.qm@web56003.mail.re3.yahoo.com> Date: Sun, 21 Nov 2010 08:36:33 -0700 Cc: admin Content-Transfer-Encoding: quoted-printable Message-Id: <418F58E7-A0B5-4F37-A5BB-8E2D0E3B4CBE@elevated-dev.com> References: <398458.12164.qm@web56003.mail.re3.yahoo.com> To: "Pourghorban.S" X-Mailer: Apple Mail (2.1081) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/160 X-Sequence-Number: 36126 On Nov 21, 2010, at 1:41 AM, Pourghorban.S wrote: > yes I know the method for implement, but I do not know where I should = implement necessary changes .... > I know that I should add a additional column in my data base tables = that show the level of access of each row.=20 > these level types is finite.=20 > and by the way I should add to a sql command which user issues, the = condition that it checks whether he / she can access / gain the row he/ = she want or not.=20 > But I don't know these two steps how and where I should implement. Now at least you're giving us questions of "how do I do this in a = database", rather than asking about how to write a thesis on a subject = very few (if any) of us know about. That's progress ;-) So you want to add a column to a table: You might want to create an enum type for the access level and use that = as the column type: How the command should work is rather vague, you might want to create a = stored function to evaluate access: But that would depend on some enforcement in an application or = middleware. A function that just checks access is not enough, you have = to enforce it. And that is a more substantial project. You might be able = to use rules. You might want to use view whose statements use = current_user(). If you have a lot of pre-existing tables to which the access info must = be added, you might want to use dynamic sql to automate adding that = column. But, given that "I should add a additional column in my data base tables = that show the level of access of each row" seemed to be giving you = trouble, you might want to first read an introductory book on SQL. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice