2013-04-29 98 views
0

我使用Azure移動服務在我的Windows 8商店應用程序中保存來自應用程序useres的數據。我想在應用商店中發佈應用,但爲此我必須確保每個用戶只能獲得他自己的數據。如果有10人將數據上傳到我的Azure服務,他們應該只能獲得他們自己的數據。我怎樣才能做到這一點?Azure - 僅針對擁有者的數據

回答

1

您應該檢查Use scripts to authorize users in Mobile Services tutorial它會告訴你如何將每個用戶的數據劃分

基本上你寫的插入操作的自定義腳本服務器端(直接在Azure的門戶網站在移動服務腳本部分)這樣

function insert(item, user, request) { 
    item.userId = user.userId;  
    request.execute(); 
} 

而且這樣

function read(query, user, request) { 
    query.where({ userId: user.userId });  
    request.execute(); 
} 

讀操作但首先你必須添加授權給您的應用程序,如Get started with authentication in Mobile Services tutorial

相關問題