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

Version Path
adva-core-0.0.14 public/javascripts/backup/jquery.roles.js
adva-core-0.0.13 public/javascripts/backup/jquery.roles.js
adva-core-0.0.9 public/javascripts/backup/jquery.roles.js
adva-core-0.0.8 public/javascripts/backup/jquery.roles.js
adva-core-0.0.7 public/javascripts/backup/jquery.roles.js
adva-core-0.0.6 public/javascripts/backup/jquery.roles.js
adva-core-0.0.5 public/javascripts/backup/jquery.roles.js
adva-core-0.0.4 public/javascripts/backup/jquery.roles.js
adva-core-0.0.2 public/javascripts/backup/jquery.roles.js
adva-core-0.0.1 public/javascripts/backup/jquery.roles.js