0

I have a site that allows users to submit a 3d print job to a lab.

The role of the site builder is: technician The content type in question is: print job

Users can submit a print job (i.e. create a print job node).

What I'd like is to enable the technician to be able to prevent/disable/stop the user from being able to use the form at node/add/print-job when they want to prevent new print jobs from coming in (i.e. too busy at the lab).

I can use the Content Access module, but I'm hoping for something a bit less complex for the technician and that doesn't result in a 403.

I'm hoping that there is a way to do this with rules or workflow. Preferably one button/checkbox with a confirmation. Disabling the content type form will display a message written by the technician on the form path.

Any help would be greatly appreciated.

  • why cant you go here and disable the access for 'technician' role "admin/people/permissions" -> "print job: Create new content" ? – NTT Dec 1 '17 at 11:52
  • I'd like the technician to be able to manage the form themselves, while limiting their access to complex and potentially troublesome admin interfaces. – ymdahi Dec 1 '17 at 15:19
0

I think you'll have to do this with code. My quick take on this would be:

  • Create a content type with an "Disallow jobs" check box and the body field.
  • Allow the technician role to view and edit this content type.
  • Create a node and add it to your menu with a "Disable/Enable jobs" link.

Use hook_form_alter() to:

  • check for the job content type form
  • load your Disable / Enable jobs node
  • Check if the disable jobs checkbox is ticked.
  • Replace the $form array with a markup entry using the text from the node.

Note if you need to have this turned off automatically (e.g. lab closed), you probably can use rules to modify the disable jobs node.

| improve this answer | |
  • thanks for the suggestion, I'll attempt to use another entity to control the node add form - I'll see if I can pull it off with Rules. – ymdahi Dec 1 '17 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.