liquid_feedback_frontend
diff app/main/opinion/_action/update.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 | 808269b7f41c |
children | 1997cf1da04b |
line diff
1.1 --- a/app/main/opinion/_action/update.lua Thu Feb 16 14:08:55 2012 +0100 1.2 +++ b/app/main/opinion/_action/update.lua Thu Feb 16 15:01:49 2012 +0100 1.3 @@ -22,8 +22,6 @@ 1.4 return false 1.5 end 1.6 1.7 - 1.8 - 1.9 if param.get("delete") then 1.10 if opinion then 1.11 opinion:destroy() 1.12 @@ -32,6 +30,13 @@ 1.13 return 1.14 end 1.15 1.16 +local degree = param.get("degree", atom.number) 1.17 +local fulfilled = param.get("fulfilled", atom.boolean) 1.18 + 1.19 +if degree ~= 0 and not app.session.member:has_voting_right_for_unit_id(suggestion.initiative.issue.area.unit_id) then 1.20 + error("access denied") 1.21 +end 1.22 + 1.23 if not opinion then 1.24 opinion = Opinion:new() 1.25 opinion.member_id = member_id 1.26 @@ -39,8 +44,6 @@ 1.27 opinion.fulfilled = false 1.28 end 1.29 1.30 -local degree = param.get("degree", atom.number) 1.31 -local fulfilled = param.get("fulfilled", atom.boolean) 1.32 1.33 if degree ~= nil then 1.34 opinion.degree = degree