1

What I need to achieve is the following - not sure the best way to go about it, hoping someone knows of an add-on or other solution:

1) User submits an entry via Channel-Form front end. All sorted.

2) Entry gets posted in one of 10 categories with status 'pending' - each of which has a specific Admin/Editor who is notified by email. Again sorted.

3) On getting the email the Admin/Editor logs in to the CP and either approves or denies the entry.

The issue is at #3 where each of the 10 editors should see ONLY the entries posted to their own category that they are the Admin for.

So, when two entries are placed in UK and USA categories respectively, the UK and USA admin each can login and see/approve only the entries with their country categories and not in any other country cat.

Obviously it's possible to restrict by channel - but is finer-grained control possible? Any suggestions?

1

There are two solutions that me and my company came up with when face with a problem like yours.

1.) You can set the author of the entry to be the id of the admin from the channel form and enable the "Can view channel entries authored by others" in the member group settings

2.) You can create a module and extension.

We ended up making a module because we had a very specific case where we couldn't change the author.

6
  • Thanks Johnathan, would it work to hardcode the Admin's ID in the Channel Form and get it passed that way regardless of the user? Would it mean that the submitter of the form would have to be not logged in?
    – segovius
    Jul 14 '14 at 21:15
  • I'm trying your approach but when I set the author of the entry to an ID of an admin in Channel Form I get "you are not authorised to perform this action" - any ideas?
    – segovius
    Jul 16 '14 at 8:00
  • 1
    I apologize for my answer. It was incorrect for me to say that you could specify that. If you need this done quickly I have made and an extension that can help. papercutinteractive.com/plugins/channel_form_author.zip Just create an input field with a name of "cfaid" and you can specify the id of the author Jul 16 '14 at 13:20
  • thanks! I'll download and give it a go, there is a bit of a rush! Cheers!
    – segovius
    Jul 16 '14 at 20:01
  • 1
    github.com/jh2os/channel-form-author I updated ext.channel_form_author.php to handle this exception Jul 18 '14 at 14:53
1

Admins can filter entries by category in the CP, but I suspect that what you want is a secure way of allowing admins to only see their own categories.

I don't know of any native way to do this in the CP, and I am unaware of any addons that will do this. Have you done a search on devot-ee?

You may want to consider approaching this via the front end where you can use the channel tag in combination with the logged_in_user_id conditional, to only list entry titles filtered by that user ID and the user's assigned category or categories. Next to each listed title, a link to a channel edit form with the link passing the entry ID. The admin can then edit the entry status, or whatever else.

EDIT STARTS HERE

I will assume that you are using the channel form for the original entries, and either the author gets to set the category or you force the category via a hidden field and conditional depending on the author ID

For this to work, each target admin member group's settings must look like this:

Include Members in PUBLISH page multi-author list? = "yes";

Can access the control panel? = "yes";

Can access CONTENT section = "yes";

Can access CONTENT: Edit = "yes";

Can edit entries authored by others = "yes".

With that many (30) admins, your template code is going to be rather verbose, but let's see if you can live with that. You need at least two templates. One to list an admin's entries to be authorised and one for the channel form where the status can be changed:

Via whatever means, (access security is up to you) you will send your admins via the front end to a template as follows:

{if logged_in_group_id == admin_id_1}

{exp:channel_entries channel="whatever" status="pending" category= admin_id_1_category_id|another_admin_id_1_category_id}

    {entry_title}<a href="{path='template_group/channel_form_template}/{channel_name}/{entry_id}">Authorize This</a>

{/exp:channel_entries}

{/if}

This is where it gets verbose - you need one of the above for each admin, plus a default to catch any non-admins that may turn up. Or you could use PHP in your template and set the category parameter dynamically according to the logged-in admin ID

Your channel form template looks something like this:

{exp:channel:form

channel="{segment_3}"

return="template_group/template/ENTRY_ID"

entry_id = "{segment_4}"

}

Content Label

Authorize Label

Submit

{/exp:channel_form}

I hesitate to mention this because it is overkill for what you want to do, but my HooBlong module has a feature that will allow you to filter inputs by category and member group, so you would not need a verbose entry listing template, and you would not need to keep updating the template if you ever needed to add/update member groups. See here.

Post your code if you need help debugging.

4
  • Thanks John... I might have to do this templating approach as a last resort. I'm going to give the setting the ID as admin a shot if it's possible to do. Might have to revisit this though probably. Cheers!
    – segovius
    Jul 14 '14 at 21:14
  • Hi John, might have to go your route on the front end. Any tips on how to handle around 30 admins each with different categories to edit/view?
    – segovius
    Jul 16 '14 at 8:32
  • 1
    See edits to my original posting Jul 16 '14 at 14:38
  • @John...thanks for taking the time for that. I'm going to give it a go after I check out Johnathan's plugin.
    – segovius
    Jul 16 '14 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.