有关用户的文件权限的问题 [英] Question about file permissions for a user

查看:80
本文介绍了有关用户的文件权限的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我被要求开发一个给定用户名和文件名的函数,以返回用户是否有权访问文件...

我已经在互联网上阅读了很多有关显式权限的内容,但是试图达到特定用户的水平.

IE. bool HasAccess(字符串用户名,字符串FileName){}


任何帮助都很棒.

预先感谢,

Phil.

Hi there,

I have been asked to develop a function that, given a user name and a file name, to return whether the user has access to the file...

I have read a lot on the internet on explicit permissions, but was trying to get to the level of the specific user.

ie. bool HasAccess(string UserName, string FileName) {}


Any assistance would be fantastic.

Thanks in advance,

Phil.

推荐答案

好问题!

我做了一些搜索,并在此处找到了一些好东西 [
Good question!

I did a bit of searching and found some goodies here[^], but the responses there are limited. The techniques posted will get you the groups that have access, but further work will be needed to find whether a user is a member of a particular group.

Best practices in the Microsoft world include granting access to groups, not users, then to assign users to groups depending on their access needs. The security model is structured to accomodate that practice, so you''ll probably have to drill down through the model to find the solution. I think the above solution will get you through the first layer, but it''s obviously not enough.


这篇关于有关用户的文件权限的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆