Project

General

Profile

Actions

Evolution #1798

closed

Same permissions for core and dynamic fields

Added by Johan Cwiklinski 4 months ago. Updated 4 months ago.

Status:
Fermé
Priority:
Normal
Category:
Fields management
Target version:
Start date:
03/03/2024
Due date:
% Done:

100%

Estimated time:

Description

Both core and dynamic fields have a "permission" notion, with similar values... But not at all the same in database :/

For core fields; this is hardcoded directly in pages/edit_core_fields.html.twig template:

[
    FieldsConfig::NOBODY => "Inaccessible", // 0
    FieldsConfig::ADMIN => "Administrator", // 2
    FieldsConfig::STAFF => "Staff member", // 3
    FieldsConfig::MANAGER => "Group manager", // 4
    FieldsConfig::USER_READ => "Read only", // 5
    FieldsConfig::USER_WRITE => "Read/Write" // 1

For dynamic fields, it's retrieved from Galette\DynamicFields\DynamicField::getPermsNames():

[
    DynamicField::PERM_USER_WRITE => _T("User, read/write"), // 0
    DynamicField::PERM_STAFF      => _T("Staff member"), // 2
    DynamicField::PERM_ADMIN      => _T("Administrator"), // 1
    DynamicField::PERM_MANAGER    => _T("Group manager"), // 3
    DynamicField::PERM_USER_READ  => _T("User, read only") // 4
]

It has to be changed to take the same arguments. Migration must be done PHP side; we cannot achieve something correct using SQL queries.

Also, it could be useful for future usages to have a "Public" permission (not reliable for core/dynamic fields).

Actions #1

Updated by Johan Cwiklinski 4 months ago

  • Category set to Fields management
  • Target version set to 1.1.0
Actions #2

Updated by Johan Cwiklinski 4 months ago

  • Status changed from Nouveau to Résolu
  • % Done changed from 0 to 100
Actions #3

Updated by Johan Cwiklinski 4 months ago

  • Status changed from Résolu to Fermé
Actions

Also available in: Atom PDF