Home Cireson Uploads
image


IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.

DISCLAIMER

All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.


Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.

Dont forget to checkout solutions uploaded by our customers, partners and community members here.
Options

Restrict Asset Admin Creation

Geoff_RossGeoff_Ross Cireson Consultant O.G.

Hey Community

I was asked if it was possible to limit who can create Asset Administration items. Be default, anyone in the Asset Management role group can create any Asset Management item. You may want the wider team creating HWAs and SWA but you might not want them creating Catalog Items or Standards.

Here's a snippet to hide the Administration open in the NEW drawer to anyone not in a specific AD group.

$(document).ready(function() {
    $('.cs-form__drawer--Administration').hide();
    $.ajax({
        url: "/api/V3/User/GetUsersGroups",
        data: {
            Id: session.user.Id
        },
        type: "GET",
        success: function (data) {
            data.forEach(function (item) {
                if (item.Name.indexOf("Cireson_Asset_Admin") != -1) { //Asset Administration Group
                    $('.cs-form__drawer--Administration').show();
                }
            });
        }
    });
});

Pop this into a js file and call it in the usual way via the script loader on all pages.

Dont forget to ensure your new Asset Administration group is synchronised into the CacheBuilder but assigning it somewhere else. I suggest on the Asset Admin Navigation node (even if you leave the main Asset Manager group their too).

Happy restricting

Geoff

Sign In or Register to comment.