Welcome to Geeklog, Anonymous Monday, June 17 2024 @ 12:15 pm EDT

Geeklog Forums

Allow static page edit but not create?


Status: offline

lfalfa

Forum User
Newbie
Registered: 04/01/04
Posts: 12
I'd like to grant permission to edit a specific static page to one user, but not allow them to create any static pages.

I was able to grant the user the permission to edit just that one page, by creating a group, giving that group the staticpages.edit right, and adding the user to the group, and then setting the static page's group access to that group (with both R and E access).

But... it seems like staticpages.edit implies the ability to create as well. Am I missing something?
 Quote

Status: offline

lfalfa

Forum User
Newbie
Registered: 04/01/04
Posts: 12
OK, here's my hack to the static page code to make this work. This is against Geeklog 1.3.8sr4 with the default Static Pages 1.3 that comes with it.

In the gl_features table, add a feature called "staticpages.create", description "Ability to create static pages", and core 0.

Text Formatted Code

INSERT INTO `gl_features` ( `ft_id` , `ft_name` , `ft_descr` , `ft_gl_core` )
VALUES (
'', 'staticpages.create', 'Ability to create static pages', '0'
);

 


In public_html/admin/plugins/staticpages/index.php, change line 40 from:
Text Formatted Code

if (!SEC_hasRights('staticpages.edit')) {


 

to
Text Formatted Code

if (!SEC_hasRights('staticpages.edit') ||
   (empty($sp_id) && $mode=='edit' && !SEC_hasRights('staticpages.create'))) {


 


With these two changes, permission to create static pages is now separate from permission to edit. You'll probably need to go into your groups and users and modify permissions accordingly. At the very least, you'll want to modify the group "Static Page Admin" and add the new "staticpages.create" permission.
 Quote

All times are EDT. The time is now 12:15 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content