Hi all,
Does anyone know of a way to create a Role that can be given access to the Trash?
In normal circumstances, I agree with Ryan's decision to allow it only to Superusers, however I'm using PW as a the admin for a contest app on Facebook, and I need the company we have handling moderation of the submissions to be able to access the Trash.
Any ideas welcome!
Thanks.
Enabling ability to access trash for a Role
Started by evanmcd, Jun 28 2012 02:54 PM
permissions users
4 replies to this topic
#2
Posted 28 June 2012 - 03:00 PM
You don't want to give access to the trash, it's a dark and dangerous stinky place.
@somartist | modules created | support me, flattr my work flattr.com
#4
Posted 29 June 2012 - 02:59 PM
It's not possible at present to give other roles access to the trash. That is an area where access inheritance doesn't exist (since it's an anything-goes bucket 'o trash). It becomes a can of worms when considered in light of access control. Do you really want someone digging in your trash? 
A couple of alternatives:
1. Consider that /trash/ is just a page with children (albeit a smelly one). But you can just as easily make your own trash page. Rather than deleting pages, ask them to change the parent to your trash page (or drag their page into it). So long as they have access, they should be able to drag stuff in and out of it. If they pages they are dragging into it use templates that inherit access, and you make your trash page not viewable to guest, then any pages dragged into it are essentially removed from the site.
2. It sounds like you might be using trash as an unpublished area. If that's the case, I recommend just using PW's Unpublished status rather than the trash.
3. If you still want to use PW's system trash, you can create a template or module that lets them undelete stuff they've deleted. This isn't complete, but gives the basic idea:
A couple of alternatives:
1. Consider that /trash/ is just a page with children (albeit a smelly one). But you can just as easily make your own trash page. Rather than deleting pages, ask them to change the parent to your trash page (or drag their page into it). So long as they have access, they should be able to drag stuff in and out of it. If they pages they are dragging into it use templates that inherit access, and you make your trash page not viewable to guest, then any pages dragged into it are essentially removed from the site.
2. It sounds like you might be using trash as an unpublished area. If that's the case, I recommend just using PW's Unpublished status rather than the trash.
3. If you still want to use PW's system trash, you can create a template or module that lets them undelete stuff they've deleted. This isn't complete, but gives the basic idea:
$deletedPages = $pages->get('/trash/')->find("modified_users_id=$user, include=all");
if(count($input->post->restore)) {
$parent = $pages->get('/some/parent/');
foreach($deletedPages as $p) {
if(in_array($p->id, $input->post->restore)) {
$p->parent = $parent;
$p->save();
echo "<li>Restored: {$p->url}</li>";
}
}
}
// display list of their deleted pages and give them a 'restore' checkbox
foreach($deletedPages as $p) {
echo "<li><label><input type='checkbox' name='restore[]' value='{$p->id}' /> {$p->title}</label></li>";
}
#5
Posted 03 July 2012 - 04:45 PM
Thanks Ryan, I think I will go for option 1. I hadn't thought of that, and it seems like a fine solution for this.
We are also using the published status, so it can't do double duty in this case. This is an odd situation in which we have an agency administering the contest that uses subcontractors to actually review the submissions. We want the agency to be able to see and remove from trash (to keep tabs on their contractors), but of course we don't want the agency doing much else in the admin.
Anyway, thanks again. I'll post back here with any tips in case someone else with a similar need stumbles across this post later on.
Cheers.
We are also using the published status, so it can't do double duty in this case. This is an odd situation in which we have an agency administering the contest that uses subcontractors to actually review the submissions. We want the agency to be able to see and remove from trash (to keep tabs on their contractors), but of course we don't want the agency doing much else in the admin.
Anyway, thanks again. I'll post back here with any tips in case someone else with a similar need stumbles across this post later on.
Cheers.
Also tagged with one or more of these keywords: permissions, users
Community Support →
General Support →
Two levels of group permissions possible?Started by JusticeParty, 15 Apr 2013 |
|
|
||
Community Support →
General Support →
Default landing page for specific roleStarted by tinacious, 06 Apr 2013 |
|
|
||
Community Support →
General Support →
Can I limit page editing to the user that created that page?Started by tinacious, 06 Apr 2013 |
|
|
||
Community Support →
Getting Started →
Restricting permissions on a specific pageStarted by jmart, 05 Apr 2013 |
|
|
||
Community Support →
General Support →
Problem uploading imagesStarted by Michal Gancarski, 18 Mar 2013 |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













