# derzeit genutzte Rollen: # * ADMIN # * EDITOR # * APPROVER # * USER # # Pfad-Zugriffsregeln # Aufbau: # path().grant[.method()][.not][.role()][.extension([, )] # or # path().deny[.method()][.not][.role()][.extension([, )] # with # : HTTP-Method name as Symbol (:get, :put, :post, :delete) or :all path('/').grant.method(:get) path(:all).grant.role(:ADMIN) path('/user/lock').deny.role(:USER).role(:APPROVER) path('/special').grant.extension(:special?, :area1) path('/pictures') do grant.role(:admin) deny.role(:guest) end # # Model-Object-Zugriffsregeln # Aufbau: # model().grant.method()[.role()][.extension([, ])] # or # model().deny.method()[.not][.role()][.extension([, ])] # or # model( do # grant..method()[.role()][.extension([, ])] # deny.method()[.role()][.extension([, ])] # ... # end model(Dashboard).grant.method(:view) model(Todo) do grant.method(:view) grant.method(:full_view).role(:ADMIN) grant.method(:update).role(:EDITOR).extension(:owned_by?) # calls Todo.owned_by?(current_user) grant-method(:delete).not.role(:ADMIN) end