locked
Retrieving the currently logged on user and uhidding screen control if the user is admin RRS feed

  • Question

  • I have a parent table Customer which is link to the orders table now on the customerorder add/edit screen I want to determine if the currently logged on user is admin/not if the user is admin I want to unhide a screen control on my customerorder add or edit screen NB. I have a attribute on my customer table that's store true if that customer is admin

    Wednesday, October 12, 2016 7:46 AM

Answers

  • You can modify this to suit your needs.  Use web api to get the user and associated permissions.  Then you can check the permissions and turn visibility on or off:

    if (myapp.permissions["LightSwitchApplication:Admin"]) {
        screen.findContentItem("ypurContentItem").isVisible = true;
    }




    • Edited by Hessc Wednesday, October 12, 2016 7:00 PM
    • Proposed as answer by Angie Xu Monday, October 24, 2016 8:25 AM
    • Marked as answer by Angie Xu Monday, October 24, 2016 8:25 AM
    Wednesday, October 12, 2016 6:53 PM