Closed (fixed)
Project:
Table Manager
Version:
5.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
11 Mar 2007 at 03:24 UTC
Updated:
12 Apr 2007 at 08:54 UTC
I (user 1) want to create tables and allow users (authenticated) to edit/maintain the entries. Is this possible?
I have selected 'Show links' for 'Display Administrative links. i've given the users permission to 'edit any table content' and 'create any table content' but I don't want to give them permission to administer/create their own table. No add/edit/delete links are displayed. How do I set this up?
Thanks,
Minna
Comments
Comment #1
pobster commentedHiya, yep you're on the right track - weirdly you also have to tell the filter function to show the admin links as well (complete overkill, but it's functionality requested by someone else hence how comes I implemented it this way). Just change your call to;
[tablemanager:1,NULL,TRUE](the TRUE is to enable the links)Thanks
Pobster
Comment #2
pobster commented...If you've enabled the table view menu item then there's a setting in the erm, "settings" ;o) to enable links in the tables.
Pobster
Comment #3
pobster commentedHmmm... I really should have read your post the whole way through properly before I answered ;o)
Well... It sounds like it should be working? If you've enabled the 'view tables' menu item and set the settings to 'show links' then users with the correct permissions should be seeing create/ edit/ delete links? You know there's a distinct possibly that part is broken in the upgrade to 5.0 - give me a while to test what's happening...
Thanks
Pobster
Comment #4
Minna commentedThanks for your response.
The administrative links seem to display for users only if I give them permission to 'Administer Table'.
Minna
Comment #5
pobster commentedOh yeah, I forgot about this! Its because for some unfathomable reason Drupal 5.0 sticks
<em>tags around the access control table names. Check it out, it reads "create table content" instead of simply "create table content" like it did in the 4.7 version. I've NO idea why... To perhaps get it working (in a hackish way) you could try changing this function;This may or may not work I'm afraid... I've been a bit too busy to look into what's going on, sorry...
Pobster
Comment #6
pobster commentedAh ignore that above, use this instead and PLEASE report back if it solves your problem or not;
All you need to do is change the six '%' symbols into '@' symbols...
Thanks
Pobster
Comment #7
Minna commentedThat worked!
I'm using this module for a grade school website. Now the lunchlady can post the Lunch Menu on her own. Thanks
Comment #8
Minna commentedI'm not sure if I should start a new issue or continue here. Please let me know if I'm doing this wrong so I learn.
I have the administrative links for users now. However, 'edit any table1 content' must be enabled for the users to get the admin links. So if I only have 'edit own table1 content' enabled for the users, they get no admin links. I didn't realize this until I added another table for another user.
Again, I'm creating the tables and the users need to edit only their own table content. This will be important when the students get involved.
Thanks
Minna
Comment #9
pobster commentedThere are no rules here so as long as I get the message then it's fine ;o)
I'm not 100% sure what you mean though? Could you go through exactly what all your tablemanger settings are, and what works and what doesn't? TBH that part of the code has *never* been tested by myself as it's not something I use... I've always had my doubts about how well it works! ;o)
Pobster
Comment #10
Minna commentedI (user 1) have created two tables. I would like each users(authenticated) to edit their own table content only.
I have selected 'Show links' for 'Display Administrative links in the 'tablemanager settings'. In 'access control' I have given permission as follows:
Permission admin authenticated user
tablemanager module x
administer tables
administer/
create own tables x
create Table1 content x
create Table 2 content x
edit any Table 1 content x x
edit any Table2 content x x
edit own Table1 content x x
edit own Table2 content x x
list tables x x
With setting each user get administrative links to all tables.
If I disable 'edit any Table1 content' or 'edit any Table2 content' , so that they only edit their own table, the users cannot see the administrative links for either tables.
Minna
Comment #11
pobster commentedHmmmm... That is strange... Well this is the code that decides whether to display the links or not;
I'd suggest perhaps changing it to;
Let me know if that works? It's all very confusing in that area... I'm sure there's probably a better way to go about doing it...
Thanks
Pobster
Comment #12
Minna commentedoops: I got the following error
Parse error: syntax error, unexpected $end in /home/saintpet/public_html/school/modules/tablemanager/tablemanager.module on line 2521
Comment #13
pobster commentedOkay! Turn it back to what it was before, what you need to do is simply add this;
|| user_access("edit own ".tablemanager_fetchname($tid)." content")into the second load of queries.I think I just missed it before?
Pobster
Comment #14
pobster commentedSo this;
becomes;
Pobster
Comment #15
Minna commentedNo errors this time, but the admin links disappear when I disable 'edit any table content'.
When I created the tables, there was no place for authoring information for the table. So how do the tables get the user permission?
Minna
Comment #16
pobster commentedIt's automatic - the users uid gets attached to tablemanager_data - check it out in phpmyadmin or something? You know... I'm sure that part of it worked okay as I remember someone else using it??? (That's before that change above) Are you sure you're using it correctly? Obviously you can only view the admin links if you've got an entry with your own uid attached to it.
...This could of course be something else which got broken in the update to 5.0?
Pobster
Comment #17
Minna commentedI double checked. Still no edit links without 'edit any table content'. The column for Operations is displayed but no edit links beside the table entries. This is a change since I added your suggestion. Before this column wasn't there.
Minna
Comment #18
pobster commentedAnd does the uid column reflect that a user *has* entered a row? Like I said, the links shouldn't show unless there is *something* there to administrate?
Pobster
Comment #19
Minna commentedNothing. Last column just shows the column title 'Operations' and two blank sub-columns below.
Minna
Comment #20
pobster commentedI think you misunderstand, you've got two entries for that table - take a look at tablemanager_data and see if the 'uid' column for those two entries matches the uid of the user you're granting permissions to.
Pobster
Comment #21
Minna commentedYou are correct. I didn't understand. I'm don't know how to look up tablemanager_data?
Minna
Comment #22
pobster commentedOkay... I've gone through the trouble of installing the module on a Drupal 5.0 test site and it works without changing anything.
I think perhaps you're not getting what the permission actually do;
create test content - allows a user to create rows in a table called 'test'
edit any test content - 'semi-administration' allows a user to edit *any* row in table 'test'
edit own test content - IF a user has created a row (to be used together with the 'create test content' permission above) then allow them to edit it. If they've nothing to be able to edit, then no admin links are displayed!
I hope this is just a misunderstanding of use! As I'm very confused!
Pobster
Comment #23
pobster commentedDo you have phpmyadmin installed? Or do you have shell access?
Pobster
Comment #24
Minna commentedI looked up the tablemanager_data. The column uid has 2.
So basically, user must create an table entry to be able to edit it. See I was trying to create the entries for the users and then let them edit/maintain. Just as I do for nodes.
I usually create a page, change the 'authoring information' to their userid and the users maintain the nodes after that. I'm working with people who aren't comfortable creating nodes or tables. But that's okay. I'm sorry if I wasted your time. Thanks!
Minna
Comment #25
Minna commentedI used phpmyadmin
Comment #26
pobster commentedIt's perfectly safe for you to use phpmyadmin to edit the uids (you can edit a group of them together that way as well!)
Absolutely no worries - happy to help. If anything you've done me a favour by pointing out that this area isn't clear and needs work! :o) Seeing as there's a complete rewrite coming - this is very helpful!
Thanks
Pobster
Comment #27
Minna commentedThat's exactly what I did - changed the uids in the tablemanager_data. Thanks for showing me.
Next I will be creating a table with 3213 entries using csv imports.
Minna
Comment #28
pobster commented