Loading...
 
Skip to main content

Architecture / Installation


Gallery Permissions query/report

Hi all,

I've been asked to produce a report which details all permissions/groups granted to each of our tiki file galleries...


The below query (postgres) very nearly gives me what I need, but it seems that "objectId" column needs to relate to a column in the table tiki_file_galleries table, but does not (IOW, my goial is to add the "name" column from table tiki_file_galleries to the results of below query...)

select "groupName", "permName", "objectId" from users_objectpermissions where "objectType"='file gallery' order by "objectId", "groupName";

Any help/insigth appreciated.

Wayne Beaver

Just in case anyone is curious, I spent a little more time, discovered that lib/userslib.php function object_has_permission forms objectId's by md5'ing a concatentation of 'objectType' string and 'obJectId' to make the objectId used by table users_objectpermissions, thus the query (in postgres syntax) for my requirements is as follows....

select b.name, a."groupName", a."permName" from users_objectpermissions a, tiki_file_galleries b where a."objectId"=md5('file gallery' || b."galleryId") order by b.name, a."groupName", a."permName";