Forum OpenACS Development: Retrieving Table Names To Which User 's Having Permissions

Hi
  My doubt is regarding the user's authentication to the tables.
  My question is "How to get the Tables List to which the openACS user's having permissions and also the Fields list to which user's are having accessble permissions."

  Plz try to get the solution as soon as possible......

Thanking You

Venu Madhav

I think you can use the acs_object_party_privilege_map view. Check out the permissions documentation here and here if you haven't already.

One might want to also look at the OpenACS Permissions Tedisouly Explained document, which is part of the OpenACS documentation since 4.6 (IIRC). Perhaps we should include information about the permissions work Don has done in it.

-Roberto

hi
i didnot get the answer to my requied question from the documentation, as i want to know if i create a table, how can i explicty decalre the permissions(the permissions shuld not be to the database users, it shuld be to the OpenACS users only) to that table, other wise i shuld create another table holding the permissions.
please reply
cheers
venu
For permssion to work you need an ACS object to set them on. Currently tables and fields are not objects. You could make a set of objects called tables and fields but the acs_object_types and acs_attributes tables basically do this.

I've written a demo that runs under acs 4.2. You can see it and get the code from trsvax.com

Yes, we've recently put together a reporting package (called report-builder, which is about to undergo primary audience testing), which makes the following acs_objects (with acs_attributes) within the system (there are actually more than these, but these are the basics):

definition
  pretty_name
  public_p
  primary_keys (1 to many object_ids of columns)
table
  schema
  table_name
  public_p
  where_clause (for filtering forced by the system)
  definition (object_id of definition)
column
  column_name
  pretty_name
  table (object_id of table)
  public_p
link
  table_one (object_id of table)
  column_one (object_id of column)
  table_two (object_id of table)
  column_two (object_id of column)
  link_type (type of join)

A definition consists of many tables, that have many columns, and are linked together by the link objects.  The primary key(s) for the definition is for accessing result sets through paginator.

This way, users can query the database on their own, and the permissions system (permission::permission_p, permission::require_permission, etc.) makes sure they are only accessing data that they are supposed to.

I still have to write the api and administration pages for the package, but expect it to be solid within a few months.  I'll post to this thread when it is.

Hi Brad Duell,
  Thank you for u r suggestion and for u r work. I want to get the privileges setted for the tables or the columns to which user is authenticated. if yes how to get them. Can you send me example for the previous problem i.e. "Retrieving Table Names To Which User 's Having Permissions" using tcl and adp scripts.

  plz give me good solution for this question with an example.

Thanking U

D.Venu Madhav.