1 of 3
1
New Extension: Entry Permissions
Posted: 19 February 2009 10:16 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

I have a project that needs really fine control over editing permissions. While EE’s group permissions are awesome, I wanted to take it a step further. I also want to use the new Structure extension, but it has a serious limitation when all ‘static’ pages are added to a single weblog. When you do that, you essentially lose all EE’s group permissions because it’s all or nothing permissions on the ‘static’ weblog.

What this extension does is piggy back off EE’s group permissions. If a particular group will be allowed any adding or editing privelages to a weblog, you’ll need to:

- assign the group access to the Publish and Edit pages
- assign the group the ability to edit entries by other authors
- assign any weblog to the user might have to post or edit entries in

What Entry Permissions lets you do is:

If the member group ‘editor’ has been assigned post and edit privileges to the ‘news’ and ‘events’ weblog, you can use Entry Permissions to restrict which entries they’re allowed to edit (entries must first be created by another admin user). So they can add ‘news’ entries, but can’t add a new ‘events’ entry, but is allowed to edit existing entries, and you can pick and choose which entries they can edit. It’s not an all or nothing setting.

This is my first extension! And it hasn’t been tested a lot, but it seems to be working so far, and it’ll be getting a lot of testing in the next couple weeks as I use it on a project. I wanted to post it here and get some feedback if possible.

One issue I’m having, is after saving the extension settings, I get a white page in the CP. It renders the CP header, and the breadcrumbs “CP Home ›  Admin” but then everything below that is white until it renders the footer… I’m not sure why it’s doing this.

Major thanks to Mark Huot, and Leevi Graham. I was referencing and borrowing code from a couple of their extensions so I knew how things were done.

Image Attachments
Picture-5.gifPicture-6.gif
Click thumbnail to see full-size image
File Attachments
entry_permissions_1.2.2.zip  (File Size: 26KB - Downloads: 273)
 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 February 2009 10:17 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

More images. If a user doesn’t have permission to edit an entry, or add a new entry to a weblog, they’re greeted with this.

Image Attachments
Picture-3.gifPicture-4.gif
Click thumbnail to see full-size image
 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 February 2009 12:47 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  202
Joined  05-11-2007

This looks like a very handy extension, and has at least some of the exact functionality I’m looking for for a particular project. Would this extension allow me to set a user’s permissions to edit certain entries in one weblog but still be able to add new entries in a different weblog?

Profile
 
 
Posted: 19 February 2009 01:06 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

Yep, you just need to first configure EE’s weblog permissions so they have add/edit permissions on the blogs, then you use this to further define permissions.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 February 2009 01:46 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  202
Joined  05-11-2007

very cool-I’ll definitely have to install it and check it out!

Profile
 
 
Posted: 19 February 2009 02:09 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  202
Joined  05-11-2007

Yikes! I installed it but the CP loaded like a blank page like you said, but it never resolved itself.

Profile
 
 
Posted: 19 February 2009 02:30 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

You’re only getting the white page after updating the settings, right? You can still install the extension and it works? Or is it completely blowing up your CP after installing it?

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 February 2009 02:38 PM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

I forgot to mention that you will need to create a new custom field to your group, and select ‘Member Group’ as the type. The name of the field doesn’t matter. This will give you the group options seen in the first screen shot in the original post.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 February 2009 10:36 PM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  202
Joined  05-11-2007

it was blowing up the CP completely. I’ll try your suggestion, though.

Profile
 
 
Posted: 22 February 2009 07:38 AM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1133
Joined  02-02-2007

Wiki’ed.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 23 February 2009 02:56 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

I’ve updated the extension a bit… fixed some PHP notices, and the minor issue of blowing up your CP.

New download is in the original post.

Hopefully after some more real life usage I’ll get around to creating some sort of documentation.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 06 March 2009 03:41 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

Found and fixed another bug. Files updated on OP.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 18 March 2009 11:04 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  312
Joined  07-24-2007

litzinger, you must have been reading my mind from a distance in the future or something. I think your extension gives the sort of granularity I can use to solve a lot of problems. I had posted a request for such in a new thread, but found your extension just today.

Gonna take it for a test drive and see how it goes. I have a lot of other extensions installed so I will let you know if it doesn’t work.

Profile
 
 
Posted: 18 March 2009 11:27 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

Good to hear! Let me know if you find any bugs smile

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 19 March 2009 10:27 AM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  312
Joined  07-24-2007

OK, I have a confirmed conflict with the Gypsy extension…after creating a field with the field type Member Group, then also designating that field a Gypsy field, the instant you try to put any value in there (ie, select someone to be able to edit that post in the Member Group field), I get the following:

MySQL ERROR:

Error Number1054

Description
Unknown column 'field_id_25_0' in 'field list'

QueryUPDATE `exp_weblog_dataSET `weblog_id` = '2', `field_id_13` = 'b4faec5b8962ba57c0a5fcd634cd60d7.gif\n\n\n\n\r', `field_id_14` = 'Yes', `field_ft_14` = 'none', `field_id_10` = 

Saving the same post with nothing checked off just saves as normal.

This isn’t much of a problem for me, I only need two Member Group fields, so I’ll just make two seperate ones.

Edit: oh, and I’m on ExpressionEngine 1.6.7 with the follow extensions installed:

jQuery for the Control Panel (v.1.1.1)
LG Addon Updater (v.1.0.2)
LG Live Look (v.1.0.3)
Gypsy (v.1.0.6)
LG TinyMCE (v.1.3.3)
File, by Mark Huot (v.3.1.1) (my modified version with fixes for the resizing small images, GIF quality problems)
Entry Permissions (v.0.2)

Profile
 
 
Posted: 19 March 2009 10:38 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  312
Joined  07-24-2007

Correction…it (the conflict with Gypsy) will be an issue for me, as I have three weblogs using the same field group, but only one of those weblogs will be a Entry-Permissions restricted weblog. Ack! I don’t want to add a Member Group assignment field to them all, just the one.

The reason they all have the same fields is for coding simplicity reasons on the template end - and the few fields they don’t have in common (mainly their relationships with each other) is why I have Gypsy installed…so if this could be fixed that would be awesome.

Also, another bug I found - I get the “You can’t assign assign editing permissions” warning on the WYSIWYG fields (using LG TinyMCE extension) when logged in as my user in a restricted member group who has editing permission on that entry but not to assign permissions to anyone else. See attached screenshot..

Image Attachments
assignment-issues-on-TinyMC.jpg
Click thumbnail to see full-size image
Profile
 
 
Posted: 19 March 2009 01:42 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  450
Joined  02-16-2007

Boo to bugs. Thanks for reporting. I’m pretty busy with other projects right now, so I’m not sure when I’ll be able to fix these.

 Signature 

@litzinger
Bold Minded add-ons

Profile
 
 
Posted: 20 March 2009 10:55 AM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  312
Joined  07-24-2007

I can understand being busy. (I’m glad I am!)

Just a little feature request, if you ever get around to it…it would be really cool to be able to lock a member group out from editing the url_title in a weblog (a whole weblog or individual posts), which you can sort of do now with taking that default field out of the Publish page, and I do, but editors can still edit the url_title in the Edit section if they check off one or more and hit “Edit” in the dropdown selection box at the bottom of the list.

I often use url_title instead of entry_id for hardcoded links to single-entry pages because they look better in the browser. Clients complain when they see “www.mydomain.com/index.php/site/page/45” or whatever. Stupid, but I get it all the time! But, if someone edits the url_title for a given entry, my hardcoded link dies…not good.

I’m mostly not much scared that a editor will even find the url_title once I remove it from the publish page, let alone that they would know what to do with it, but you never know. :D That would really dumb-proof one’s workflow if one needed it…

Profile
 
 
Posted: 24 March 2009 11:37 PM   [ Ignore ]   [ # 18 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  245
Joined  06-25-2008

Another bug…

When I go to the Extensions panel in the CP, I get this at the top of the screen:

Warning: Utilities::include(/opt/home2/jccacweb/public_html/systemfolder33/extensions/ext.entry_permissions.php) [function.Utilities-include]: failed to open stream: Permission denied in /opt/home2/jccacweb/public_html/systemfolder33/cp/cp.utilities.php on line 147

Warning: Utilities::include() [function.include]: Failed opening ‘/opt/home2/jccacweb/public_html/systemfolder33/extensions/ext.entry_permissions.php’ for inclusion (include_path=’.:/usr/share/pear’) in /opt/home2/jccacweb/public_html/systemfolder33/cp/cp.utilities.php on line 147

...and it doesn’t show up in the extensions list, so I can’t even enable the extension. All I did was upload the extension and the language file. Seems like a core system conflict rather than a conflict with any other extension / plugin?

Nick

 Signature 

nickfoxall.com | ExpressionEngine Development in Hong Kong

Profile
 
 
   
1 of 3
1