Sha256: 97244fe4d631f194427f3d17e6bb01c96c7a8b26532c1b9ae2695a5e146c27ab
Contents?: true
Size: 677 Bytes
Versions: 37
Compression:
Stored size: 677 Bytes
Contents
class SpudPermission attr_accessor :tag, :name, :apps def initialize(tag, name, apps=nil) self.tag = tag self.name = name self.apps = apps || [] end # Find a permission by tag def self.find(tag) return Spud::Core.permissions.find{ |p| p.tag == tag } end # Returns hash of permissions, grouped by tag namespace def self.grouped_by_tag return Spud::Core.permissions.group_by do |p| p.tag.split('.').first end end # Returns array permissions sorted by tag def self.sorted_by_tag return Spud::Core.permissions.sort_by(&:tag) end # Returns all permissions def self.all return Spud::Core.permissions end end
Version data entries
37 entries across 37 versions & 1 rubygems