BootTrait - If no active user is given, then run CLI as superuser#56
BootTrait - If no active user is given, then run CLI as superuser#56totten wants to merge 1 commit intocivicrm:masterfrom
Conversation
|
Is this still relevant? I like this concept! |
Yeah, I think the same idea/critique still applies -- that it would be more systemically consistent to set a default super-user for CLI commands. Another example of this came up with Rather than merge this PR, it probably makes more sense to re-factor the stuff used for The other angle (which applies to #56 and also #145) is that a policy-change could be compatibility-break. So it would be nice to do coordinated increment (e.g. |
Example:
cv api4command tended to complain because the default/unauthenticated condition was to fail the permission check.cv api4currently has a work-around to setcheckPermissions=>FALSE, although this wouldn't apply if you usedcv ev civicrm_api4(...);ang:module:listhas 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.checkPermissions => FALSEmeans that it never checks permissions.cv api4 Contact.getwould run without permission checks... but if you specifiedcv 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:listcase, 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.