liquid_feedback_frontend
diff app/main/draft/_action/add.lua @ 0:3bfb2fcf7ab9
Version alpha1
author | bsw/jbe |
---|---|
date | Wed Nov 18 12:00:00 2009 +0100 (2009-11-18) |
parents | |
children | 80c215dbf076 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/draft/_action/add.lua Wed Nov 18 12:00:00 2009 +0100 1.3 @@ -0,0 +1,14 @@ 1.4 +local initiative = Initiative:by_id(param.get("initiative_id", atom.integer)) 1.5 + 1.6 +if Initiator:by_pk(initiative.id, app.session.member.id) then 1.7 + local draft = Draft:new() 1.8 + draft.author_id = app.session.member.id 1.9 + draft.initiative_id = initiative.id 1.10 + draft.content = param.get("content") 1.11 + draft:save() 1.12 + 1.13 + slot.put_into("notice", _"New draft has been added to initiative") 1.14 + 1.15 +else 1.16 + error('access denied') 1.17 +end