1
0
-1

Hi.

 

How to give permission to web/json/console/app/(*:appId)/(~:version)/datalist/list so that everyone can access. Current user role for this datalist is only Admin. i want this api can be access to all user.

    CommentAdd your comment...

    1 answer

    1.  
      2
      1
      0

      Hey there izzat,

      As long as the JSON authentication uses the Admin credentials, it is completely up to you on how to handle the JSON output to display to end users.

      Hope this clarifies.

      1. izzat

        if i use ajax and add Authenticate by Passing Parameters like below, if i refresh the tab, why the user change from user1 to admin? <script> $(document).ready(function(){ $.ajax({ type: "POST", url: 'http://localhost:8080/jw/web/json/workflow/assignment/list/pending';, data: { j_username : 'admin', j_password : 'admin' }, success: function(res) { console.log(res) }, dataType: "json" }); }); </script>

      2. izzat

        I use the Master login method, i append "?j_username=admin&j_password=admin&loginAs=cat" to my url. Why the app redirect me to page login?

      3. izzat

        if i add "?j_username=admin&j_password=admin&loginAs=cat" to my url like this "/jw/web/json/data/list/inspektoratBangunan/listJadual" , why app redirect me to the login page?

      4. Justin

        Hey izzat, how did you test the script above? The user will change if this is tested via browser dev tool or in browser URL directly, since the browser will retain its session. By using tools such as JSON Tool, it does not retain the session.

      5. izzat

        Hi justin, i test my api by using browser URL directly. it redirect me to login page. how can i use my api?

      6. Justin

        By testing that way, it will change the logged in user. Try testing by running it in runtime instead.

      CommentAdd your comment...