cms icon indicating copy to clipboard operation
cms copied to clipboard

Allow some read-only admin settings when allowAdminChanges = false

Open mijewe opened this issue 5 years ago • 16 comments

Description

I'd like to be able to see (as in, read-only) some admin settings, even if allowAdminChanges is false.

For example, I want to check my SMTP details are correct, but I don't want to allow them to be changed since I want them controlled through the yaml.

Currently I'm changing allowAdminChanges to true, having a quick peek to check everything's in order, then setting it to false again, which isn't ideal.

  • Craft version: 3.1.28
  • PHP version: 7.3
  • Database driver & version:
  • Plugins & versions:

mijewe avatar Jun 06 '19 12:06 mijewe

For what it's worth, I'd suggest having read-only Settings section access be restricted to Admins only.

Is there any sort of ETA for this? 3.5? 4.0?

proimage avatar May 22 '20 12:05 proimage

Would need to be 4.0 at the earliest, since plugins are also involved in showing their settings, and currently they don't have to worry about the possibility of a read-only mode.

brandonkelly avatar May 26 '20 20:05 brandonkelly

Hmm... all those settings are saved in the Project Config, right? What about a stopgap solution where you allow admins to basically view the contents of project.yaml in some form or another, right in the backend? It doesn't need to be fancy, just functional. At the most rudimentary, perhaps a phpinfo()-style page that just prints out the project.yaml contents, where you can use native browser search to find the setting you're interested in?

A very useful enhancement to something like that would be to present that raw project.yaml info hierarchically, in an accordion (<details> & <summary>, perhaps?) or something. Add a simple "Expand all" / "Collapse all" button at the top to allow in-page browser searching, and that's it.

¯\_(ツ)_/¯

proimage avatar May 28 '20 11:05 proimage

I don’t think the settings views should look significantly different when admin changes are disabled. Maybe we could introduce a new “Project Config” utility instead, similar to PHP Info.

brandonkelly avatar May 28 '20 15:05 brandonkelly

That would definitely suffice for me! :)

proimage avatar May 31 '20 10:05 proimage

Does it also make sense to have the Craft log files viewable via the backend? I could certainly stand to have that functionality on a production site I'm working on right now (GUI DB backup failed, said to check Craft logs for details, but I don't have access to the load-balanced servers...).

proimage avatar Jun 05 '20 10:06 proimage

We’ve added a new Project Config utility for the next Craft 3.5 beta release! In addition to giving you a dump of the current project config data, it also provides handy access to a couple project config maintenance actions.

The new Project Config utility coming in Craft 3.5

brandonkelly avatar Jul 10 '20 23:07 brandonkelly

The fact that setting allowAdminChanges to false makes the Settings section completely inaccessible is still a big pet peeve of mine in dealing with Project Config. The utility exposes the current contents of the project config itself, but that data isn't necessarily the same thing as the actual current settings in the database. It's also much less efficient than it would be to simply open up the appropriate Settings page, when needing to quickly review/check current settings in a production environment.

I realise this issue is closed, but would propose to re-open the FR in discussions.

mmikkel avatar Aug 17 '21 12:08 mmikkel

Fair enough, I’ll reopen.

brandonkelly avatar Aug 17 '21 16:08 brandonkelly

Perhaps disabling the Save button throughout the Admin section could be a simple & temporary solution?

proimage avatar Aug 18 '21 09:08 proimage

To help add context, we have engineering managers and project managers who would prefer to review the Section, Settings, and Entry Type structures of our CraftCMS for team discussion but we don't want to risk someone could edit these concepts on our staging and production environments. Having allowAdminChanges=false lock Settings into a read-only mode would help the team continue to ideate and discuss the CraftCMS structure without danger of altering it.

While I think the Project Config utility above is a great add, it doesn't quite meet the use case of easy viewability into the structure of our sites.

acekevin avatar Sep 15 '21 15:09 acekevin

I needed to see some email settings today. I don't have the site locally, and simply needed to confirm what production was using. I had to contact a dev - who had to spend time getting the site up to date on their machine to look. What should have taken 1 minute took 20 minutes.

Would be far easier to look at these settings in a read only way.

ryanmasuga avatar Feb 07 '22 17:02 ryanmasuga

An alternative, and potentially more useful approach than making things "read-only", would be for admins to be able to manually toggle allowAdminChanges, from the CP, for the duration of their session.

Apart from solving being able to see config, it would also allow admins to make "emergency" changes, where initiating a deployment might be undesirable, or impossible.

timkelty avatar Feb 07 '22 17:02 timkelty

Got bit by this two times in one day. Needed to look at some Solspace Freeform settings to confirm something for client, only to find that I cannot see those on live site. I don't have local copy of this site, so I have to ask one of our devs. This is a great way for devs to log more billable hours!

ryanmasuga avatar Feb 07 '22 19:02 ryanmasuga

An alternative, and potentially more useful approach than making things "read-only", would be for admins to be able to manually toggle allowAdminChanges, from the CP, for the duration of their session.

Apart from solving being able to see config, it would also allow admins to make "emergency" changes, where initiating a deployment might be undesirable, or impossible.

That would sort of solve it, I guess. I still think the ideal solution would be to have the Settings section always available, in a read-only state and without having to expose the project config for changes at all.

mmikkel avatar Feb 08 '22 09:02 mmikkel

I still think the ideal solution would be to have the Settings section always available, in a read-only state and without having to expose the project config for changes at all.

Fair enough, maybe my solution is a separate use case then.

timkelty avatar Feb 08 '22 14:02 timkelty