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

The start of an extension: Member Group Permissions

Development and Programming

circa1977's avatar
circa1977
118 posts
16 years ago
circa1977's avatar circa1977

The project I’m currently working on is a password-protected site for the financial services industry, where accounts are managed using the Member Module. This is working fine, but the sensitivity of the site’s content leaves me worried that I’ve overlooked access restrictions on a template. Template Access Restriction is easy enough to manage via the Template Preferences Manager but, as far as I know, there’s no way to review what permissions have been set.

The attached PHP file does that. If you drop it in into a template with PHP enabled and set to output (I put my template in an “Admin” template group) and visit the URL, you’ll see a table that displays:

Your member groups across the top (originally preceded and grouped by your sites for MSM, but site has no bearing on member group and access).

A list of all your templates down the left, grouped by site and template group.

A Yes/No indicator of whether each member group has access to that template.

My goal is to get this into an extension that can be displayed in the Control Panel, as it’s a crucial administration step for me.

If anyone has a chance to drop this into their site and check it out, I’m sure some QA is warranted. Feedback is appreciated.

Mark

       
circa1977's avatar
circa1977
118 posts
16 years ago
circa1977's avatar circa1977

Update posted: Template’s site_id was hard-coded in the per-member_group query to check access. That’s been corrected.

       
circa1977's avatar
circa1977
118 posts
16 years ago
circa1977's avatar circa1977

Updated again: Sites have no bearing on member groups & access to templates, and have been removed from the top of the table. It is now just member groups on top, templates by site/group down the left.

The first approach was actually broken for your secondary site as the site ID is ignored for member_group/template access.

       
circa1977's avatar
circa1977
118 posts
16 years ago
circa1977's avatar circa1977

Updated. I just got burned by this again and added the template that each template redirects to when access is denied to the grid.

       
circa1977's avatar
circa1977
118 posts
16 years ago
circa1977's avatar circa1977

Forgot to add: The direction I really need to take this is to build a tab into the entry publish/edit screen, so you can manage permissions at the template level.

       
Scott Hepler's avatar
Scott Hepler
11 posts
16 years ago
Scott Hepler's avatar Scott Hepler

Mark:

Thanks so much for this! It’s a super-useful tool.

-s.

       

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.