Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#2404 - Afform - Resolve ambiguity of omitted permissions #19657

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

totten
Copy link
Member

@totten totten commented Feb 22, 2021

Overview

This addresses some ambiguities/confusion in permission for Afform. The basic question -- if permission is omitted (in various ways -- unset, null, empty-string), then what is the effective permission?

https://lab.civicrm.org/dev/core/-/issues/2404

Before

  1. If *.aff.json does not specify a permission -- or specifies a null permission -- then it uses a default (access CiviCRM).
  2. If *.aff.json specifies permission as an empty-string, then the runtime generates errors.
  3. When editing a form in the GUI, the "Permission" field provides an "x". Clicking "x" produces the text "Open access" and sets permission to an empty-string.
    Screenshot from 2021-02-22 15-02-08
    Screenshot from 2021-02-22 15-02-21

After

  1. If *.aff.json does not specify a permission -- or specifies a null permission or empty-string permission -- then it uses a default (access CiviCRM).
  2. When editing a form in the GUI, the "Permission" field cannot be removed. You must have some value.

Comments

There are a few differing ways one might go at this:

  1. Apply a consistent default of access CiviCRM
  2. Apply a consistent default of *always allow*
  3. Apply inconsistent defaults (where null and empty-string produce different behaviors).

IMHO, option 1 is less bad than the others:

  • Option 1 effectively takes a small number of forms that never worked as labeled -and gives valid but tighter permissions than expected.
  • Option 2 effectively takes a small number of working forms that were semi-private -- and changes them to fully public.
  • Option 3 will be more confusing over the long-term.

@civibot
Copy link

civibot bot commented Feb 22, 2021

(Standard links)

@civibot civibot bot added the master label Feb 22, 2021
@seamuslee001 seamuslee001 self-assigned this Feb 23, 2021
@seamuslee001
Copy link
Contributor

I tested this locally and confirmed that it works merging

@seamuslee001 seamuslee001 merged commit e60ef0d into civicrm:master Feb 23, 2021
@totten totten deleted the master-aff-perm-blank branch February 24, 2021 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants