This look like a very useful extension and may solve some of our permissioning problems. Just one minor issue; the extension settings will not save when I submit. Any ideas as to what I may have missed? Thanks.
I had the same problem. You need to update with the file attached to this post.
There still are some issues here I noticed: - weblog entries to which I have given a certain group full access to are not showing up in the edit section. I can post new ones though. - in stead of a “you are not authorised” message, I would like that particular weblog to be removed from the publish tab. - a blank page appears when adjusting the extension settings - in firefox I get this error:
Notice: Undefined variable: r in /xxx/public_html/xxx/extensions/ext.entry_permissions.php on line 420
Here is something you can add to the Stucture module that will remove the link from pages that the current user doesn’t have permission to edit.
in modules/structure/tpl/structure_admin.tpl.php
Modify the following chunk of code:
<?php if( $entry_permissions and !$entry_permissions->_check_editing_permissions($eid, $site_id, $entry['weblog_id']) ): ?>
<span class="pageTitle"><?php echo $entry['title']; ?></span>
<?php else: ?>
<a href="http://<?php" title="Edit page" class="pageTitle">_ <?php echo $entry['title']; ?>_ </a>
<?php if ($view_add_page): ?>
<a href="http://<?php" title="Add child page" class="addPage"> _ +add page _ </a>
<?php endif; ?>
<?php if ($entry['listing_wid']): ?>
<span class="addEdit">
<span class="addEditLabel">Entries: </span>
<a href="http://<?php">; ?>" title="Add an entry to this page."]Add</a>
/
<a href="http://<?php">; ?>" title="Edit an entry on this page."]Edit</a>
</span>
<?php endif; ?>
<?php endif; ?>
and in modules/structure/mcp.structure.php in the admin method, add the following code somewhere before the ob_start():
$entry_permissions = false;
$entry_permissions_query = $DB->query("SELECT class, settings FROM exp_extensions WHERE class = 'Entry_permissions' AND enabled = 'y' LIMIT 1");
if($entry_permissions_query->num_rows == 1)
{
require(PATH_EXT.'ext.entry_permissions.php');
$entry_permissions = new Entry_permissions;
}
This is an unsupported hack, but has worked for me on a previous project.
Ok, I installed 1.2 but:
Notice: Undefined variable: field_id in /home/xxx/public_html/xxx/extensions/ext.entry_permissions.php on line 701
MySQL ERROR:
Error Number: 1054
Description: Unknown column 'field_id_' in 'field list'
Query: SELECT field_id_ AS field FROM exp_weblog_data WHERE entry_id = '13' AND weblog_id = '5' AND site_id = '1'
Ok, just updated to 1.2.1. Get the file from the original post, or at http://www.brianlitzinger.com/ee/
It was an issue where it tried to see if you had permissions to edit an entry, but you hadn’t created the Member Group field yet. So if that field type doesn’t exist, it just returns true and the entry is editable.
Hope to god the bugs are squashed now… for my first extension this one had a few…
‘Fraid not… The settings are not sticking, the empty screen is still there after submitting settings.
Updated to 1.2.2. All I changed was a priority from 1 to 2, because it doesn’t have to be a 1. Uninstall the extension, and go into the DB and actually remove all the hooks from the exp_extensions table for Entry_permissions. There was an old hook that was called on session_end that didn’t need to be called. Once I removed that a couple versions ago I didn’t have that problem anymore. Right now the extension works perfectly for me in my sandbox environment. If it’s still not working for you send me a list of all the extensions you have installed.
Sorry for my bad English. I installed the extension. But when I do the settings, then when I click SUBMIT, I get a blank page and I do not take the settings. I had previously created a field on the weblog, which attracts a group. I do not understand why. I checked the file permissions and I have set to 644.
Charles66, are you using version 1.2.1? If so did you install a previous version? There was an issue where I was using an unnecessary hook that caused the blank screen, which I removed, and haven’t had the blank screen since. If you ARE using 1.2.1 let me know and I’ll look into it again.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.