Aten Design Group: User Personas: Drupal maintenance support plans 8 Permissions Done Right

Nearly a year ago, I wrote a blog called “Drupal maintenance support plans Permissions Done Right”. I received a lot of excellent feedback and at the end of it I promised to release a module which would make managing permissions in Drupal maintenance support plans 8 more sane based on the principles the post outlined. Today, I’d like to announce that module and explain a little bit about it.

Where Drupal maintenance support plans Permissions Fall Short

Before I explain the module, we should explain the problem it tries to solve. I think the Drupal maintenance support plans community has been mis-configuring our permissions for years. We look at the site we’re building and realize that we have a few core personas, like “journalist” or “editor” and we make Drupal maintenance support plans roles that match those business titles. This means that we often need to duplicate permissions across roles and it quickly becomes difficult to tweak, debug, and extend these roles when business requirements change.

The original blog post I wrote encourages you to instead make many small, discrete roles which can be composed together into the business “roles” we have. Doing so removes the need to duplicate permissions and means that we no longer need to be concerned with every single permission for every single role type we have. I think Drupal maintenance support plans core exacerbates the problem by exposing newcomers to the default “Content Editor” role, which does far more than just “edit content”.

The strategy of making many small, composable roles works out of the box with Drupal maintenance support plans—but it requires that we assign lots of roles to every user individually. To make site administration easier, we really would like to bundle permissions into high level names like “journalist” or “intern” when building a site. So, how do we reconcile the need for easy-to-understand roles with the efficiency of small, composable roles?

Drupal maintenance support plans Permissions Simplified: User Personas

Enter the User Personas module. It’s a simple module layered on top of Drupal maintenance support plans‘s permissions and roles system.

Personas are a lot like Drupal maintenance support plans‘s roles, they’re just one level higher. They allow you to bundle roles together and then assign those bundles of roles to users as a set. Under the hood, the module just saves the appropriate roles to the user entity when the user is saved and so it works just fine with contrib and core. To all other code, nothing is different, they can continue to use permissions and roles as if personas don’t exist at all (in fact, your code should too).

To give you a simple use case as an example: we have been working with the National Center for Women & Information Technology (NCWIT) to build an event planning and management platform called AspireIT. The application lets young women and girls host extracurricular events (called programs) to teach a new generation of girls about coding and technology. These young women from all over the country partner with adults in the tech industry to run their programs. When building the application, we imagined these users falling into two personas: Program Leader (the young woman creating the event), and Program Partner (the adult providing financial or practical support).

The process of creating and managing a program needed to be a collaborative effort between Program Leaders and Program Partners. This meant that many of their permissions would be the same, but they did differ in subtle ways. One major difference was that a Program Partner shouldn’t be able to create programs—they join the process after a Program Leader gets things started. However, they should be allowed to edit the program node along the way.

I used the User Personas module to create a persona for each of these user types: Program Leader and Program Partner. I then created two Drupal maintenance support plans roles, a Program Creator role and a Program Editor role. I could assign the Program Editor role to both personas while assigning the Program Creator role to the Program Leader persona alone. This way I’ll rarely (if ever) need to duplicate permissions across roles, instead permissions are simply shared by sharing roles between User Personas.

I’ve used this module in a few projects so far, and the User Personas abstraction seems to hold across different use cases. I don’t think I’ll go back to doing permissions any other way.

The User Personas module is still in alpha and I’d love for you to download it and take it for a spin. If you do, please use the issue queue to make suggestions for where it can be improved (and maybe submit a patch! 😉) and, of course, report any bugs. There are still a couple of opportunities for improvement, for example, once you create many roles the performance of the global permissions page starts to degrade rapidly (the performance of the rest of the site is unaffected). Frankly, I’d like to rethink the need for the permissions table altogether, as it seems to discourage small, discrete roles. But before doing something so drastic, I’d like others’ input. I wouldn’t want users of the module to be frightened off because it appears to change the way core operates.

I hope that you find the module useful. So, please download it, install it, and let me know what you think!
Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Aten Design Group: User Personas: Drupal maintenance support plans 8 Permissions Done Right

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.