Sha256: ca8fcf5be4eb0cb1242e299bf315556a0fbad3339e61d3eb3b8de2fc8fb8a205
Contents?: true
Size: 580 Bytes
Versions: 15
Compression:
Stored size: 580 Bytes
Contents
module Aegis class Normalization VERB_NORMALIZATIONS = { "edit" => "update", "show" => "read", "list" => "read", "view" => "read", "delete" => "destroy", "remove" => "destroy" } def self.normalize_verb(verb) VERB_NORMALIZATIONS[verb] || verb end def self.normalize_permission(permission) if permission =~ /^([^_]+?)_(.+?)$/ verb, target = $1, $2 permission = normalize_verb(verb) + "_" + target end permission end end end
Version data entries
15 entries across 15 versions & 5 rubygems