2

I have this scenario in my application:

Every registered member, can manage up to 3 content-types. And manage nodes based on their own content-types. They can manage their own content-types and nodes.

edit: the number of registered members might reach more than 1000

How can I approach this?

opening administer content-types permission for authenticated-users is definitely not an option. Also there could be a lot of confusions regarding dynamic permission, custom roles, etc...

Is creating content-type of node-content-types possible?

Are there any contributed modules or distribution for this specific features?

Thanks

edit02: Some explanations, I hope it's clear..

  • user can manage his content-types by: creating new content type, edit/delete existing ones. he also can manage his nodes too.

  • also, different user, cannot see other's content-types, but can see other's published nodes

  • All content types (and it's fields) shouldn't be overlapped. maybe the user's name is included in the content-type machine name generator (and field's) to avoid duplicates

  • I'm not sure about the idea "creating content-type of node-content-type"

3
  • What exactly do you mean with "manage content types" (what kind of "management"? Can there be any "overlap" between the 3 content types of any 2 users? Are those nodes assumed to be of a either of these 3 content types? What do you mean by "creating content-type of node-content-type"? Consider adding a few samples to make your question easier to understand ... Jun 29, 2015 at 17:01
  • ok thanks for your input. I have updated my question. I'm not sure about the idea "creating content-type of node-content-type". It's kinda like "I create a content-type, but the node from it, is also a content-type"... pretty confusing lol...
    – Bonn
    Jun 29, 2015 at 18:00
  • With this extra edit things are quite a bit more clear (all of a sudden you now have TWO answers ...). Any chance to provide some more details about that "max of 3"? Like what if somebody tries to create a 4th one, how to prevent that, etc? Jun 29, 2015 at 18:28

3 Answers 3

1

this could be done, but I think it's too broad for the Q&A approach of Drupal Answers. In general, if I was to try this, I would start with this:

  • add an integer field to the user (to track number of content types)

  • using Field Permissions, hide that field from anyone but admin

The Field Permissions module allows site administrators to set field-level permissions to edit, view and create fields on any entity.

  • create a role with the appropriate permissions to add content types

  • if permission allows viewing the content type list, use Rules to check that url against role to ensure new 'content type moderators' cannot access the list and redirect with a message

The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.

  • override the hook_form_alter() to check the integer value of the hidden field on content type creation, redirect or show message if user is at limit

  • override the form submit() function to increment the integer value of the hidden field on content type creation, and create perhaps a custom block, menu entry or other element to allow the user access to edit the content type later on

0

Another approach to consider: Organic Groups (with permissions like "registered users can create their own group, of which they are the owner, so that they can "manage" whatever is related to that group).

Probably combined with Rules (like to automate some things trigger by Organic groups related "events") and/or Content Access (to secure group related "stuff", e.g. as a rules related "action" ) ...

Not sure yet if you'd need anything related to the Flag module (which is often used in combination with Rules). In your case anything related to "user specific, which might not be possible / handled by the Organic Groups module.

Depending on how your question can further be enhanced (more specific about what you actually want), I might be able to further enhance this answer also.

1
  • I havent used OG before, I'll check it out. Meanwhile, I found module entityform, it seems to be what I need. I'd add some custom module to support it to handle the permission and limitations...
    – Bonn
    Jun 30, 2015 at 0:31
-1

Try and see if Webform: https://www.drupal.org/project/webform does what you want to achieve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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