2013-04-29 97 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

相关问题