[development] allowing some users some days to write stories
Larry Garfield
larry at garfieldtech.com
Tue Feb 5 16:19:26 UTC 2008
Actually if you define your own node type rather than using the GUI (it's only about 30 lines of boilerplate code) then you can control the hook_access() implementation and put the check there. That would be much cleaner.
--Larry Garfield
On Mon, 4 Feb 2008 18:24:28 -0500, "Ken Rickard" <agentrickard at gmail.com> wrote:
> Yes. You could create a specific node type for this -- call it "Birthday
> Post" -- and then give 'create birthday post' permissions to all users.
> Then use hook_form_alter() to check their birthdate.
>
> - Ken
>
> On Feb 4, 2008 10:16 AM, Lluís <enboig at gmail.com> wrote:
>
>> This would require give story creation permissions to all users and
>> then check if this is his/her birthday?
>>
>> On 04/02/2008, Ken Rickard <agentrickard at gmail.com> wrote:
>> > hook_node_grants() has no effect on creating nodes.
>> >
>> > You probably want to have users register their birthday, then load
> that
>> into
>> > the $user object.
>> >
>> > Then use hook_form_alter() to run an IF check on node creation forms.
>> >
>> > - Ken
>> >
>> >
>> >
>> > On Feb 4, 2008 4:44 AM, Lluís <enboig at gmail.com> wrote:
>> > > I am trying to write a module to allow my web users to write stories
>> > > just during their birthday web; how can I achieve this?
>> > >
>> > > I am using Drupal5 and I suppose it is done using
> hook_node_grants(),
>> > > but I don't really get it; any hint is wellcome.
>> > >
>> > > thanks
More information about the development
mailing list