Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Clearly you need to check it at your back-end side, otherwise your application is likely to exploit by a kid.</p> <p><strong>Update</strong></p> <p>you need to implement an authorisation mechanism in your back-end, then after you load the permissions at the beginning, you can add it to the user session, so you don't need to look-up the database each time, you just need to check the user permission against the task required permission.</p> <p><strong>More</strong></p> <p>To implement the authentication mechanism: Goal, <code>user</code> can see it's own profile but <code>supervisor</code> can see everyone within his <code>department</code>.</p> <ul> <li><code>user</code> A has the <code>user_id</code> already loaded at the session, let say <code>user_id = 123</code></li> <li><code>user</code> A can only request his information so <code>if (user_id == req_user_id)</code> then show the information, otherwise show error.</li> <li><code>user</code> B has the permission value of <code>100</code>, let's call him <code>supervisor</code> then. Now <code>if (user_id == req_profile_id)</code> is not <strong>true</strong> we will check the permission. Let say the task permission for this particular task is <code>10</code> so <code>if (user_perm &gt;= task_perm)</code>, go ahead and check the department, if both the requested user and current user are at the same department, then show the information, otherwise show an error.</li> </ul> <p>this should works based on your information.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload