locked
web security RRS feed

  • Question

  • User-167507740 posted

    are we able to restrict the access by the control on the web page ? 

    For example, 

    there are 2 button (new record, delete record) in this webpage, admin is allowed to click both button. Normal user can only click new record button. 

    Monday, March 18, 2019 3:36 AM

All replies

  • User1520731567 posted

    Hi limcheehang,

    are we able to restrict the access by the control on the web page ? 

    For example, 

    there are 2 button (new record, delete record) in this webpage, admin is allowed to click both button. Normal user can only click new record button. 

    According to your descriptions,I suggest you could hide or show based on role.(More user friendly).

    You could refer to this demo:

    https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_hide_show

    <script>
    $(document).ready(function(){
    if(xxx)
    {
    $(xx).hide();
    }
    else
    {
    $(xxx).show();
    }
    });
    </script>

    You could also disabled button based on role.,like this demo:

    https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_disabled

    if(xxx)
    {
    <button type="button" disabled>new record</button>
    }
    esle
    {
    <button type="button">new record</button>
    }

    Best Regards.

    Yuki Tao

    Monday, March 18, 2019 7:42 AM