[support] advice on how to tag articles as exclusive to certain roles for a specific timeframe?

Jason Flatt drupal at oadaeh.net
Tue Jun 5 12:48:05 UTC 2007


On Monday 04 June 2007 11:56:44 Brian Tully wrote:
>
> I'd like to be able to add several form fields to an article (node) that
> would allow an administrator/author to specify if it is exclusive to a
> specific role.
>
> If so I'd like a pulldown menu that allows me to select which role it
> should be exclusive to.

If I understand what you are trying to do here, I'd recommend looking at an 
access control module [1], like Node privacy byrole [2] (though that one 
hasn't been formally ported to Drupal 5, yet, but there is a patch to do it), 
and combining it with the Actions [3] and Workflow [4] modules.


> Then I'd like start date and end date fields to specify when this
> article should remain exclusive (the idea being that once it's past the
> end date it will no longer be exclusive and therefore be available to
> everyone).

What you want to use for this is the Actions [3] and Workflow [4] modules.


> Secondly, there doesn't seem to be any way of requring that if the
> exclusive checkbox is checked that the Role pulldown and startdate and
> enddate fields are completed. I appear to only be able to say that the
> start date and end date are required, even though they should not be if
> the exclusive checkbox is not checked.

You're going to have to get your hands dirty and write some code to make that 
happen [5] [6].


> Third, I'm not sure how using CCK I would add a pulldown menu that
> dynamically gets filled with all roles. Is this possible?

I'm surprised there hasn't been a CCK module created that does this. 
Therefore, the only way to make this happen, other than using an access 
control module [1], is custom coding [5] [6].

[1] http://drupal.org/project/Modules/category/74
[2] http://drupal.org/project/node_privacy_byrole
[3] http://drupal.org/project/actions
[4] http://drupal.org/project/workflow
[5] http://api.drupal.org/api/5
[6] http://api.drupal.org/api/5/function/hook_form_alter

-- 
Jason Flatt
http://www.oadaeh.net/
Father of Six:  http://www.flattfamily.com/ (Joseph, 14; Cramer, 12; Travis, 
10; Angela; Harry, 7; and William, 12:04 am, 12-29-2005)
Linux User:     http://www.xubuntu.org/
Drupal Fanatic: http://drupal.org/


More information about the support mailing list