1

I'd like to allow a certain role can add new content of a certain content-type ONLY between two dates. Before or after these dates the role shouldn't be able to create a new content of this content-type.

Is it possible through the Drupal core or any module? I haven't found anything about it.

2

You can implement hook_node_access() (This is now a real hook in Drupal 7) and implement whatever you want.

3
  • Mmmm, It sounds great. I hadn't thought about this hook. Nevertheless, I would have to create some frontend to save the date interval and role affected. I don't want to edit ".module" file every time. Thanks.
    – user709
    Apr 8 '11 at 12:33
  • Yeah, sure, but you will have to do that whatever way you implement the access check.
    – Berdir
    Apr 8 '11 at 13:10
  • I've created a "date field" in my content-type with a default value (maximum date for which an user has permissions to add new content for this content-type). The problem is I can't access to this field from "hook_node_access". Furthermore, this value is encrypted in database and I can't do a db_query to retrieve this value. Any suggestions?
    – user709
    Apr 11 '11 at 12:43

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.