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

BootTrait - If no active user is given, then run CLI as superuser #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

totten
Copy link
Member

@totten totten commented Dec 14, 2019

Example:

  • Initially, the cv api4 command tended to complain because the default/unauthenticated condition was to fail the permission check. cv api4 currently has a work-around to set checkPermissions=>FALSE, although this wouldn't apply if you used cv ev civicrm_api4(...);
  • The ang:module:list has problems listing CiviMail modules b/c they have a funny perm check.

I think this may actually be better than the current workaround in api4, e.g.

  • Using checkPermissions => FALSE means that it never checks permissions.
  • Using this would mean cv api4 Contact.get would run without permission checks... but if you specified cv api4 Contact.get -U alice, then it would apply the permissions of the named user.

I haven't tested the impact on that api4 use-case. I initially wanted to improve the ang:module:list case, but something else in CiviMail still makes that funky.

This could be a change if someone has a custom-script that is intended to run as anonymous+unprivileged user (cv scr my-script.php), although I suspect that's the exception rather the rule.

Anyway, I'm just gonna file the PR and the let idea gel a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant