因为 UnderMyControl.com 允许用户管理资源权限,所以对于那些可以被授予访问权限,也可以向其 他用户授予访问权限的用户,UnderMyControl.com 需要其各自的配置文件;不过,A. Datum 帐户(用户 名和密码)仅存储在 A. Datum 的 ADAM 服务器中。
建立新资源
当新文档或新歌曲上载到 A. Datum 的相应应用程序时,该应用程序会在 UnderMyControl.com 中创 建一个关联的资源,并使用 UnderMyControl.com Web 服务设置默认权限,如图 6 所示。
Figure 6 创建关联的 资源
// connect to the Under My Control web service
umc.Service svc = new umc.Service();
svc.CookieContainer =
(System.Net.CookieContainer)Session["CookieContainer"];
// guid for the Under My Control music project
Guid projectGuid = new Guid("5f2739ff-a441-44fd-8c68-545a6d654e69");
// guid for the newly created resource
Guid resourceGuid;
// create new resource with name set to uploaded file name
svc.CreateResource(FileUpload.FileName, projectGuid, out resourceGuid);
// Set the permissions for the resource
// add the user as an owner of the new resource
svc.AddOwnerToObject( (Guid)Session["User_GUID"], resourceGuid);
// UMC permission ids for this project
const int READ_PERMISSION = 13;
const int WRITE_PERMISSION = 14;
// give user read (aka download) and write permissions
svc.CreateACL( (Guid) Session["User_GUID"], resourceGuid,
READ_PERMISSION);
svc.CreateACL( (Guid) Session["User_GUID"], resourceGuid,
WRITE_PERMISSION);
(编辑:应用网_镇江站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|