Sha256: 9b77f5ae0cd440c8dab761efc949b80ca2fe0c2b90f4b7e1290e342581403206
Contents?: true
Size: 666 Bytes
Versions: 71
Compression:
Stored size: 666 Bytes
Contents
class Caboose::PermissionPlugin < Caboose::CaboosePlugin def self.admin_nav(nav, user, page) return nav if user.nil? || !user.is_allowed('permissions', 'view') item = { 'id' => 'permissions', 'text' => 'Permissions', 'children' => [] } if (user.is_allowed('permissions', 'view')) item['children'] << { 'href' => '/admin/permissions', 'text' => 'View All Permissions' } end if (user.is_allowed('permissions', 'add')) item['children'] << { 'href' => '/admin/permissions/new', 'text' => 'New Permission' } end nav << item return nav end end
Version data entries
71 entries across 71 versions & 1 rubygems