liquid_feedback_frontend
diff app/main/suggestion/_action/add.lua @ 281:b77e6a17ca77
Check unit voting right where neccessary, hide action buttons for units without voting right
| author | bsw |
|---|---|
| date | Thu Feb 16 15:01:49 2012 +0100 (2012-02-16) |
| parents | 23c98752e697 |
| children | a176129ce282 |
line diff
1.1 --- a/app/main/suggestion/_action/add.lua Thu Feb 16 14:08:55 2012 +0100 1.2 +++ b/app/main/suggestion/_action/add.lua Thu Feb 16 15:01:49 2012 +0100 1.3 @@ -4,6 +4,12 @@ 1.4 return false 1.5 end 1.6 1.7 +local initiative = Initiative:by_id(param.get("initiative_id", atom.integer)) 1.8 +if not app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id) then 1.9 + error("access denied") 1.10 +end 1.11 + 1.12 + 1.13 local name = param.get("name") 1.14 local name = util.trim(name) 1.15