tiki-wiki: how do i force newly created pages into a category based on the user's group?

423 Views Asked by At

I need for certain users to only be able to create pages in certain categories based on their permissions. One reason for this is approvals ("flagged revisions"). If a user can create content outside of any category, then it could show up live on the web site. Even thought it wouldn't initially be linked anywhere directly in an existing page (except other unapproved pages) this can still be a problem.

I can prevent the user from creating a new page in the global scope (apparently this corresponds simply to "edit" permissions as I don't see a special permission for creating new pages), and then I can grant them permission to edit pages in the category their group is authorized to edit. But I can no longer see the "Menu:Wiki:Create a Wiki Page" option, and I can't figure out how to allow the user to create a new page in that category.

I can edit the group and set the "Default category assigned to uncategorized objects edited by a user with this default group" to the desired category. When I do that, a user in that group now has a "Create a Wiki Page" option show up in the Menu:Wiki sub-menu, but clicking on that does not bring up a new page for editing; instead if just brings up a list of existing wiki pages, without the option to create a new one!

If I create a link to the new page from an existing page, I am unable to edit it in any way. Clicking the link takes me to a page which indicates that the page does not exist, but which does not provide any way to edit it. Putting the title of the page directly in the URL, as in tiki-editpage.php?page=New+Page+Name brings up a "You do not have permission to edit this page" error page. Since any new page created by the user should have the category they have permission to edit, this does not make sense unless the category isn't set until after the initial edit permission check occurs, which creates a catch-22!

How do I let the user create a new page in any of the categories they have permissions to edit in?

If Categories are not the best tool for the task that's okay too. I don't really understand the difference between Categories and Structures with regards to which is better for what I'm trying to accomplish, however it seems Categories are the more "native" feature, which is why I am trying to use them.

1

There are 1 best solutions below

0
On
  1. Set the default category in the group.

  2. Set the default group in user properties. (important)

  3. edit categorize_list.php and insert line 38

    $cats[] = $userlib->get_user_group_default_category($user);

34 if ($cat_object_exists) {
35    $cats = $categlib->get_object_categories($cat_type, $cat_objid);
36 } else {
37    $cats = $categlib->get_default_categories();
38    $cats[] = $userlib->get_user_group_default_category($user);
39 }
  1. Clear all caches