Qཁม
!
if (request.user.id == document.owner_id) {!
// Ϣʔβ͜ͷจॻΛฤू͢Δ!
}!
!
…!
!
if (request.user.id != document.owenr_id) {!
// จॻಡΈऔΓઐ༻!
}
!
final boolean user_owns_document = (request.user.id == document.owner_id);!
!
if (user_owns_document) {!
// Ϣʔβ͜ͷจॻΛฤू͢Δ!
}!
!
…!
!
if (!user_owns_document) {!
// จॻಡΈऔΓઐ༻!
}
Slide 17
Slide 17 text
if (!(file_exists && !its_protected)) Error("Sorry, could not read file.");
QυɾϞϧΨϯͷ๏ଇΛ͏
Slide 18
Slide 18 text
QυɾϞϧΨϯͷ๏ଇΛ͏
if (!(file_exists && !its_protected)) Error("Sorry, could not read file.");
if (!file_exists || is_protected) Error("Sorry, could not read file.");