Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//Add a module for the buttons on the page.
(function (testModule) {
var getDeleteButton = function () { return document.getElementsByClassName("deleteButton"); };
var show = function (elem) {
if (elem) {
for (var i = 0; i < elem.length; i++) {
if (elem[i]) elem[i].style.display = 'inline';
}
}
};
testModule.showDeleteButton = function showDeleteButton() {
show(getDeleteButton());
};
})(window.TestModule = window.TestModule || {});
//on doc ready show/hide the buttons.
$(document).ready(function () {
TestModule.showDeleteButton();
});
//initialize the ability based authorization utilizing the Hero project
Hero
.configure({ endpoint: "http://localhost:54573/Abilities/" })
.registerAbility(Hero.Ability("Delete"), TestModule, TestModule.showDeleteButton);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.