O'Reilly logo

Drupal 8 Blueprints by Alex Burrows

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restricting fields

If we wanted to hide fields from users, we could simply just drag them into the Disabled fields on Manage form display and Manage display for our content type. However, we want to do this for our user role of organizer.

To administer the field permissions, we need to edit the field, so let's start off by editing the Day. This page will look familiar; however, you will notice there is a new section called Field visibility and permissions.

There are three options for this:

  • Public: Anyone can edit and view this field
  • Private: Only author and admin can view this field and its value
  • Custom: Specific user roles can view, add, or edit the field value
Fig 1.2: Custom permission for field

In Fig 1.2, we can see a similar matrix ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required