Allow users to add nodes

Created on 23 March 2023, over 1 year ago
Updated 18 April 2023, over 1 year ago

I am working on a set up where:

  1. a new node is created
  2. the access scheme term field is populated...
  3. ...which creates a new access section
  4. the node is assigned to that access section
  5. the node author is assigned to that access section

And that's all working fine.

But my issue I'm now seeing, is that the users do not actually have the ability to create the nodes in the first place! They get an access denied screen - which is 'fixed' by giving them the override Workbench Access perm.

Is that working as designed? On the basis that the access term field is on the content type - and is blank?

In my use case, users can't be added to a section in order to be allowed to create nodes in that section, because the section only comes into existence when they add the node!

Is there a way to say that Workbench Access perms don't apply to adding nodes, only to editing nodes? Or any other suggestions.

Thanks!

πŸ’¬ Support request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Katy Jockelson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Katy Jockelson
  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    We discussed this in a long Slack thread.

    Yes. It is.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Can the summary of that be posted here for anyone finding this via search engines

  • πŸ‡ΊπŸ‡ΈUnited States Katy Jockelson

    We discussed edit access at length - and thank you again for that.
    The use-case I explained goes out the window if users can't create nodes that they then, as the author, get automatically assigned to the same section as the node.
    Is there any way to separate edit/add access? Or an alternative solution anyone can think of?

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    So the issue here is workbench_access_entity_create_access returns false for a user with no sections.

    One approach could be to have a generic section, and auto-add that to a user in a hook_user_insert.

    At least they'd have one section then.

    Alternatively something like hook_module_implements_alter could wipe workbench_access_entity_create_access out of existence.

  • πŸ‡ΊπŸ‡ΈUnited States Katy Jockelson

    Thank you @larowlan

  • πŸ‡ΊπŸ‡ΈUnited States agentrickard Georgia (US)

    To be clear, I closed this in favor of ✨ Add option to auto add node-author to the selected editorial section if not already present Active , which seems like the proper solution to the stated problem.

    If we just let users create, they could get locked out of that content.

    The alternative, which I would define in a new issue, is to create a permission "Create and edit own content without assignment" that lets people bypass Workbench Access for content that they own.

  • πŸ‡ΊπŸ‡ΈUnited States Katy Jockelson

    To follow up with something that works for me here.

    larowlan suggested:

    So the issue here is workbench_access_entity_create_access returns false for a user with no sections.

    One approach could be to have a generic section, and auto-add that to a user in a hook_user_insert.

    At least they'd have one section then.

    A neater solution, that worked with my setup, was to create a generic section and then use the 'Roles' feature to say all users with role X are automatically added to that. That mitigated the need to write code to auto-assign each user to the generic section.

Production build 0.71.5 2024