Sha256: e942fb4ed6975b5bd346c38089b5b1da63ae9e51b23c802268d83544dd38f7be
Contents?: true
Size: 559 Bytes
Versions: 7
Compression:
Stored size: 559 Bytes
Contents
(function($) { authorize_elements = function(roles) { if($.inArray('superuser', roles) > -1) { var elements = $('.visible_for'); } else { var elements = []; $.each(roles, function() { $.each($('.' + this.toString()), function() { elements.push(this); }); }); } $.each(elements, function() { element = $(this); if(element) { element.removeClass('visible_for'); } }) } $(document).ready(function() { authorize_elements(['anonymous']); }); })(jQuery);
Version data entries
7 entries across 7 versions & 2 rubygems