We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension: Entry Permissions

Development and Programming

Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

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?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

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

       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

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

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
mooo's avatar
mooo
168 posts
16 years ago
mooo's avatar mooo

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

       
Laisvunas's avatar
Laisvunas
879 posts
16 years ago
Laisvunas's avatar Laisvunas

Wiki’ed.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

Found and fixed another bug. Files updated on OP.

       
LynneL's avatar
LynneL
239 posts
16 years ago
LynneL's avatar LynneL

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.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
16 years ago
Brian Litzinger's avatar Brian Litzinger

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

       
LynneL's avatar
LynneL
239 posts
16 years ago
LynneL's avatar LynneL

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 Number: 1054

Description: Unknown column 'field_id_25_0' in 'field list'

Query: UPDATE `exp_weblog_data` SET `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)

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.