-
-
Save eirikb/0098ae3c74544633a5eb9e3f857d74ab to your computer and use it in GitHub Desktop.
This file contains 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
$(document).ready(function () { | |
function isValid() { | |
// Issue Summary - *Show* | |
$('nobr:contains("Issue Summary")').closest('tr').show(); | |
// Description - *Show* | |
$('nobr:contains("Description")').closest('tr').show(); | |
// Data Domain - *Show* | |
$("select[Title='Data Domain']").closest('tr').show(); | |
// Issue ID - *Show* | |
$('nobr:contains("Issue ID")').closest('tr').show(); | |
// Work Package ID - *Show* | |
$('nobr:contains("Work Package ID")').closest('tr').show(); | |
// Issue Score - *Show* | |
$('nobr:contains("Issue Score")').closest('tr').show(); | |
// Priority - *Show* | |
$('nobr:contains("Priority")').closest('tr').show(); | |
} | |
function isNotValid() { | |
// Issue Score - *Hide* | |
$('nobr:contains("Issue Score")').closest('tr').hide(); | |
// Priority - *Hide* | |
$('nobr:contains("Priority")').closest('tr').hide(); | |
} | |
checkrole('Owners', function (valid) { | |
if (!valid) return isNotValid(); | |
checkrole('Administration', function (valid) { | |
if (!valid) return isNotValid(); | |
isValid(); | |
}) | |
}); | |
function checkrole(groupname, cb) { | |
$().SPServices({ | |
operation: "GetGroupCollectionFromUser", | |
userLoginName: $().SPServices.SPGetCurrentUser(), | |
async: false, | |
completefunc: function (xData) { | |
var valid = ($(xData.responseXML).find("Group[Name='" + groupname + "']").length == 1); | |
cb(valid); | |
} | |
}); | |
return IsvalidRet; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment