Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    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. This table or related slice is empty.
    1. COThe only problem is that the record is still updated based upon Id, so the site could be wrong & still update the wrong record. The only true way to verify the site is to query the database for the message, check the site id, and then compare it to the site id that the user is allowed to access. This would require an additional trip to the database, which I was trying to avoid. The composite id would fix this problem by requiring that the site id and id be used. Currently, I've resorted to native SQL to fix this problem, but I was hoping that I could add additional criteria to the Update.
      singulars
    2. CO"so the site could be wrong & still update the wrong record." -- Not if you perform updates using a method similar to the one I wrote as an example. If a login is compromised the attacker can only do what the application allows. If the app. or server is compromised so that an attacker can bypass this method or write their own SQL then the only protection is frequent backups.
      singulars
    3. COJamie, thanks for your response. I guess the short answer to my original question is that you cannot add criteria to an update. In your example I would still have to query for the original message in the database, update the status field, leave the site id alone, and then call your MessageUpdate method with the message and current site that the user is allowed to access. This will certainly work, but using native sql I can avoid the query and use a where statement to verify that the users site id matches the site id in the record. If no records are updated, I can take various actions.
      singulars
 

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