Permissions by user field

Created on 24 January 2023, almost 2 years ago
Updated 20 April 2024, 8 months ago

Problem/Motivation

Currently the TAC lite module adds a new form to control the user access permissions. A custom user data model is used to store selected terms, grouped by vocabulary.

A different approach would be to add taxonomies as fields to the user object. Advantages:

  • Allow custom form widgets for editing selected taxonomies.
  • Allow selected terms to be exposed to views.

Proposed resolution

The attached patch

  • Removes the custom user access form and its route;
  • Adds a user presave hook that will save terms of a user to the appropriate tac lite config realm;
  • Adjusts the arguments of some helper functions from Node to Entity.

Remaining tasks

Saving data in the tac lite user data config may be redundant, but changing this would be a major refactoring.

User interface changes

Access by taxonomy form removed from user account interface and replaced with field form widget.

Note that the taxonomy field(s) used for permissions must be manually added to the user entity.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden meanderix

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024