Sha256: d7557f8d9d357b4973c4ad0819063ab5b4094c6988cc5b15af6be66c225127f8
Contents?: true
Size: 414 Bytes
Versions: 23
Compression:
Stored size: 414 Bytes
Contents
class RoleDecorator < ApplicationDecorator def can?(scope, account) role_scopes = account_permissions(account).map(&:scope) role_scopes.include?('manage') || role_scopes.include?(scope) end def has?(scope, account) account_permissions(account).map(&:scope).include?(scope) end def cached_permissions garner.bind(h.controller.session_token) do object.permissions end end end
Version data entries
23 entries across 23 versions & 1 rubygems