Jump to content

How to give permission for a non superuser to edit module config


Recommended Posts

Hi all,

Title says it all really. Have created a little site-specific module and want to give a non-superuser access to edit the module settings. What's the best way to go about this.

I've added a nav item to the the setup menu using the getModuleInfo() array in the module file but this just returns a 'The process returned no content.' message. Should I be redirecting this the config screen or rendering the config screen into this page somehow?

Thanks,
J

Incidentally the icon I choose for the module isn't rendering - do I just choose the name from FontAwesome for this?

Link to comment
Share on other sites

After reading up further I see I should have built my own UI on a Process page rather than using a module config screen to achieve this. 🙈

I never realised there was such a disconnect between using module config screens and the UI of Process modules. It would be awesome if there was a way to optionally pull module config screen into the Process page view as most of the simple modules I need to make for sites don't need more than what the config screen provides other than granting permissions to non super users.

Don't know if anyone has come up against this or created a work-around?

Link to comment
Share on other sites

Settings Factory was created precisely for this use case - no need to create a module, module config;

You can also keep your fields in your module with default values, and let your site admins override those in the Settings Factory "settings".

To put it simply, if you are building out module-like code on the front end, but need to expose settings for things to your editors, Settings Factory has the ability to create unlimited settings pages, each with their own permissions...

  • Like 2
Link to comment
Share on other sites

yep - since the settings definitions are defined in json or php files they can be copied from site to site and then setup in the admin (simply create a page under /admin/ and then set the process as SettingsFactory, then type in the path to the settings definition file).

In terms of exporting actual settings, like the values, I have thought about that as well, as it would be nice to be able to back up the settings for any given single settings configuration.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...