Gossamer Forum
Home : Products : DBMan : Customization :

Another Add Permission Mod question

Quote Reply
Another Add Permission Mod question
Hi All,

I am trying to set up the "add permissions mod" and have been successfully able to install it all the way till step 5. I have not moved forward as I am not sure how to proceed. Here is my situation.

I have a DB with permission to view own records only ($auth_view_own = 1;). I want to set up an additional permission that will allow the holder to view all records irrespective of ownership, somewhat like a supervisor. The additional permission is required only for the "supervisor" to be able to view records and not to modify or delete any records. I am unable to figure out what to do.

Any help will be appreciated.

FHN
Quote Reply
Re: [fhnaqvi] Another Add Permission Mod question In reply to
Hi All,

I think I may have got the solution with a little hit and trial and some hacking. The solution seems to be working fine for me for the moment and I will update if I run into any issues. Here is the modification that I made.

Script: db.cgi

search in: sub querry

search for:

($restricted = 1) if ($_[0] eq "view" and $auth_view_own and !$per_admin);
($restricted = 1) if ($_[0] eq "mod" and $auth_modify_own and !$per_admin);

Replace with:

unless ($_[0] eq "mem"){

($restricted = 1) if ($_[0] eq "view" and $auth_view_own and !$per_admin);
($restricted = 1) if ($_[0] eq "mod" and $auth_modify_own and !$per_admin); }

This solution should work assuming you would have installed the "add permissions mod" by JPDeni and the new permission names are as suggested in the mod.

I am not really good at programming but any feedback, questions, suggestions are welcome.

FHN

Quote Reply
Re: [fhnaqvi] Another Add Permission Mod question In reply to
ooops !! I think I spoke too soon. I thought I had the ne permission thing figured out but for some reason it doesnt seem to be working any more ! may be I was hoping it would work and I just saw what I wanted to see.

My bad!!

I am back to square one it seems. any suggestions?

FHN
Quote Reply
Re: [fhnaqvi] Another Add Permission Mod question In reply to
Hi All,

OK I got the above code to work. The only change was that the line

unless ($_[0] eq "mem"){

needs to be changed to

unless ($per_mem){

I have done some tests and it seems to be working fine for the moment. Let me know if you come across some problems or issues.

FHN