aboutsummaryrefslogtreecommitdiff
blob: f323a5191d90a4fd6adfe21c6f8a26e00481cb19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'permissions/set'
# Modules helping to manage permissions
module Permissions
  # If you include this administrators will be allowed to do everything,
  # others users will will be able only to view.
  module AnyoneCanViewAdminCanChange
    multi_permission :create, :update, :destroy do
      acting_user.administrator?
    end

    def view_permitted?(field)
      true
    end
  end
end