如何授予小程序访问其所需资源的权限?
我在为我的小程序定义权限时遇到问题,该权限将访问空间资源,例如获取 user.name 属性或文件系统命令,例如创建、读取、写入目录或文件...
小程序必须写入任何数据 -ex。图像-从临时目录中的此类文件中的网络应用程序接收到的图像,并使用 user.name 为这些文件创建一个文件夹...
我想签署小程序并为其授予权限,以便每个运行我的小程序的客户端都允许它访问资源需要访问权限,我该怎么做? 是否可以?
这是一种没有客户端授予权限的方法吗? 我知道这不是好的安全策略,而且可能是不正确的想法,但是根据我的问题陈述,您的想法是什么? 我怎样才能做到这一点?
i have a problem with define permission for my applet that would to spacial resource access like get user.name property or file system command like create,read, write directory or files...
the applet must write any data -ex. images- that received from a web application in such files in temp directory with using user.name to make a folder to these...
i want to sign applet and grant permission for it so that every client which runs my applet permission it to resource access that is needed, how i can do it?
is it possible?
is it a method without client side grant permission?
i know that's not good security policy and maybe incorrect idea , but with my problem statement what's your idea?
how i can do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一旦您的小程序被签名,任何需要文件权限的代码都需要包装在特权块中,如下所示。
为了获取系统属性,您需要再次使用特权块。像这样的东西。
Once your applet is signed, any code that needs file permissions needs to be wrapped in a privileged block as follows.
For getting a system property you need to use the privileged block again. Something like this.
从 6u10 开始,无需签名即可使用 FileSaveService 允许在用户的控制下保存文件。
From 6u10, without being signed you can use FileSaveService to allow files to be saved under control of the user.