getgrav / grav-plugin-login

Grav Login Plugin
http://getgrav.org
MIT License
44 stars 54 forks source link

How to grant admin access on account creation? #210

Open fulltrucker opened 5 years ago

fulltrucker commented 5 years ago

We have spun up a few Grav sites to use for client documentation, and while ideally we'd like our clients to be able to edit pages through a front-end interface we haven't found anything suitable (yet) so we're going to give them access to the Admin plugin interface in order to facilitate them editing and adding pages. Example site:

https://rtfm.ginkgo.st/~ca/

We built a custom child theme for the Learn2 theme that adds a couple things like a TOC on the right hand side of doc pages, and some tweaks to the styles.

The trouble I'm having is in granting access to the Admin plugin when a user signs up for an account using the Login plugin. We also have the Admin Addon User Manager Plugin installed, with the intent of granting the client's tech lead access to manage other users' access if need be. They're saavy, but not necessary "make edits to yaml files and use the CLI to push changes to the repo saavy".

Here's what my login.yaml file looks like, but in every test user registration I've done only the site:login permission is given to the new user. Thoughts? Help? Thanks!

enabled: true
built_in_css: true
redirect_to_login: true
redirect_after_logout: /
route_activate: /activate_user
route_forgot: /forgot_password
route_reset: /reset_password
route_profile: /user_profile
route_register: /user_register
route_unauthorized: /user_unauthorized
dynamic_page_visibility: false
parent_acl: true
protect_protected_page_media: false
rememberme:
  enabled: true
  timeout: 604800
  name: grav-rememberme
max_pw_resets_count: 0
max_pw_resets_interval: 60
max_login_count: 0
max_login_interval: 2
user_registration:
  enabled: true
  fields:
    - username
    - password
    - email
    - fullname
    - title
  access:
    site:
      login: true
    admin:
      login: true
      super: false
      cache: true
      configuration: false
      configuration_system: false
      configuration_site: false
      configuration_media: false
      configuration_info: false
      settings: false
      pages: true
      maintenance: false
      statistics: true
      plugins: false
      themes: false
      tools: false
      users: false
    admin-addon-user-manager:
      users: false
      groups: false
      users_expert: false
  redirect_after_registration: /admin
  options:
    validate_password1_and_password2: true
    set_user_disabled: false
    login_after_registration: false
    send_activation_email: false
    manually_enable: false
    send_notification_email: true
    send_welcome_email: true