blob: 923ba978ff7b7858528f0f3f63bff38450a99766 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
require 'permissions/set.rb'
class Approval < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
timestamps
end
belongs_to :user, :null => false
belongs_to :agenda, :null => false
validates_presence_of :user_id, :agenda_id
validates_uniqueness_of :user_id, :scope => :agenda_id
def view_permitted?(field)
true
end
multi_permission(:create, :destroy, :update) do
return false unless user_is?(acting_user)
return false unless acting_user.council_member?
true
end
end
|