grav-plugin-admin icon indicating copy to clipboard operation
grav-plugin-admin copied to clipboard

Question: Permission to create Pages in "folder"

Open Cacodaimon opened this issue 3 years ago • 0 comments

Hello,

I want to allow some users to create new pages in certain "folders" e.g. to create a new blog post.

Adding a sub page fails with the following error: "You have insufficient permissions for task add."

This is my user which can edit a blog page but can not add a new blog post:

state: enabled
email: [email protected]
fullname: 'Max Mustermann'
language: en
content_editor: default
twofa_enabled: true
twofa_secret: XXX
avatar: {  }
hashed_password: XXX
groups:
  - Employee
  - FAQ
  - Blogger
  - KnowledgeBase
  - ImageSources
access:
  admin:
    login: true

This is my groups.yaml:

Employee:
  access:
    admin:
      login: true
      super: false
      cache: true
      configuration: false
      pages:
        read: true
        list: true
      maintenance: false
      statistics: true
      plugins: false
      themes: false
      tools: false
      users: false
      flex-objects: false
  readableName: Employee
  description: Employee
  icon: user
  enabled: true
FAQ:
  access:
    admin:
      login: true
      faq: true
  readableName: FAQ
  description: 'Can manage the FAQ'
  icon: question-circle
  enabled: true
Blogger:
  access:
    admin:
      login: true
      pages:
        read: true
        list: true
  readableName: Blogger
  description: 'Can manage Bloggposts'
  enabled: true
KnowledgeBase:
  access:
    admin:
      login: true
      pages:
        read: true
        list: true
  readableName: 'Knowledge Base'
  description: 'Can manage the Knowledge-Base'
  enabled: true
Legal:
  access:
    admin:
      login: true
      pages:
        read: true
        list: true
  readableName: Legal
  description: 'Can manage Legal content'
  enabled: true
ImageSources:
  access:
    admin:
      login: true
      pages:
        read: true
        list: true
  readableName: 'Image sources'
  description: 'Can manage Image sources content'
  enabled: true

This is the blog.en.md for example:

---
title: Blog
blog_url: Blog
content:
    items: '@self.children'
    order:
        by: date
        dir: desc
    filter:
        published: true
permissions:
    groups:
        Blogger:
            create: true
            read: true
            update: true
---

This is our blog!

===

Some md content…

When adding a page within the Parent Page (Blog): Screenshot 2021-08-06 at 18-29-56 Blog ( de ressourcen blog )

The following error occurs: Screenshot 2021-08-06 at 18-21-30 Blog ( de ressourcen blog )

How the groups / users / pages must be configured in order to allow sub page creation without giving the general "Pages create" role?

Thanks in advance!

Cacodaimon avatar Aug 06 '21 16:08 Cacodaimon