Sha256: bfb20078fefd15587587e2935f5f1626d71aac578c44f47efb9a9931293c4613
Contents?: true
Size: 708 Bytes
Versions: 9
Compression:
Stored size: 708 Bytes
Contents
# frozen_string_literal: true require_relative 'application_policy' module ProxES class TokenPolicy < ApplicationPolicy def create? user.super_admin? end def list? create? end def read? record.id == user.id || user.super_admin? end def update? read? end def delete? create? end def register? true end def permitted_attributes attribs = [:email, :name, :surname] attribs << :role if user.super_admin? attribs end class Scope < ApplicationPolicy::Scope def resolve if user.super_admin? scope.all else [] end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems