Created
September 1, 2017 05:33
-
-
Save joshbooker/f5b2aa754f45d1bb580e854563ee6bbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="~/GeneratedArtifacts/viewModel.js" /> | |
myapp.BrowseUsers.created = function (screen) { | |
// Write code here. | |
myapp.userPermissions = []; | |
screen.getUserPermissions().then(function (p) | |
{ | |
p.data.forEach(function (p) | |
{ | |
myapp.userPermissions.push(p.Name); | |
}) | |
}).then(function () | |
{ | |
if (myapp.UserPermissions["Users_CanInsert"]) | |
{ | |
screen.findContentItem("AddUser").isEnabled = true; | |
} | |
else | |
{ | |
screen.findContentItem("AddUser").isEnabled = false; | |
} | |
//if (myapp.UserPermissions["Users_CanUpdate"]) | |
//{ | |
// screen.findContentItem("EditUser").isEnabled = true; | |
//} | |
//else | |
//{ | |
// screen.findContentItem("EditUser").isEnabled = false; | |
//} | |
}) | |
}; | |
myapp.BrowseUsers.beforeApplyChanges = function (screen) { | |
// Write code here. | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment