Sha256: b43a69100ae9bc6b7ed00588ae9f327dd9fe77f164979dfb7dbe0c2d3937f7ed
Contents?: true
Size: 490 Bytes
Versions: 10
Compression:
Stored size: 490 Bytes
Contents
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']); });
Version data entries
10 entries across 10 versions & 1 rubygems