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

Add permission for overriding Y Styles #169

Open
andriokha opened this issue Nov 9, 2023 · 3 comments
Open

Add permission for overriding Y Styles #169

andriokha opened this issue Nov 9, 2023 · 3 comments

Comments

@andriokha
Copy link
Contributor

IIUC currently the Y Styles details element for overriding default styles is shown to anyone with access to the layout builder form. I'd find it useful for it to be behind a permission (eg .override ws settings). Would that be something you'd consider? (Currently I'm using a form alter.)

Thanks!

@podarok
Copy link
Contributor

podarok commented Nov 23, 2023

Could you share the code snippet with your form alter, please? @andriokha

@shelleygoetz
Copy link

@andriokha please see above - can you provide the code snippet with your form alter? We have an issue for this in the March release.

@andriokha
Copy link
Contributor Author

Sorry everyone I was out of action for a little bit. The code we've been using is the following in a general hook_form_alter():

  // Hide the Y Styles override details element.
  // @see https://github.com/YCloudYUSA/y_lb/issues/169 for a possible nicer
  //   approach.
  if (str_ends_with($form_id, '_layout_builder_form') && !empty($form['ws_settings_container'])) {
    $form['ws_settings_container']['#access'] = FALSE;
  }

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

No branches or pull requests

3 participants