问题标签 [user-permissions]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
703 浏览

asp.net-mvc - 如何为我的 CRUD 设置权限?

我正在学习 ASP.NET MVC3,我刚刚为我的模型/上下文创建了一个控制器。但是,任何人都可以导航到这些页面并使用它们。如何设置这些页面的权限?

0 投票
0 回答
3011 浏览

javascript - Alfresco : 非管理员用户无法将站点变为中等模式

我的 Alfresco 应用程序的 Share 部分有问题。确实,当我以普通帐户(不是管理员)登录并访问未选中“中等”选项的已创建站点时,每次我想修改站点的详细信息时都会收到一条错误消息,并且检查中度选项。
错误消息如下:

当站点已在“中等”选项下创建或您以管理员帐户登录时,该问题永远不会发生。

这里有控制台日志:

该错误来自“site.put.json.js”网页脚本,其中包含以下源代码:

所以,如果你有什么建议...

0 投票
1 回答
658 浏览

php - How to implement a permissions system that varies according to the values a user is attempting to save?

The context is a educational administration system built on the Zend Framework. We are implementing a RESTful MVC to handle pretty much all data interactions with clients. Relationships between resources are mapped in the database with foreign keys etc.

Example case: a teacher creating a report on a specific student.

We currently have a role-based permissions system that can be tailored to the level of the individual role (using, eg, teacher_5 as the role name). Therefore we can easily restrict access to an already existing report (by generating permissions in the report model that allows edit/put permissions on the report only to the tutor role who created it, say). The problem comes on creation. In order to add a report a user can post to /reports, say, the following data:

The problem is that tutors are only allowed to create new reports on a certain subset of student_ids - those students that they are teaching.

One approach would be to treat this as a validation issue on that field. The issue with this is that we want to protect ourselves from making mistakes, and that is not easy to do with validation (the code would have to know in advance that special validation is expected on certain fields).

The other would be to somehow extend our permissions system to a completely granular one (i.e., there would be a permission for every field in every model), and then extend our current permissions system to responding to paramaterised permissions checks. So if we wanted to know if the current user has permissions to add student_id 10 to a report on creation, we would end up with something like

where $resource would be a report model, $role would be the teacher teacher_5, $action would be "post", $field would be student_id, and $value would be 10. The acl class would essentially handle a call to the $resource itself.

We are not sure which direction to take, but presumably this is a fairly common issue, so we are wondering what approach other people have taken.

0 投票
2 回答
4081 浏览

couchdb - CouchDB 每用户数据库方法对于拥有大量共享数据的用户是否可行?

我想实现一个 webapp - 一个集成来自各种来源的数据并将它们显示给用户的提要。用户应该只能看到他有权读取的提要项目(例如,因为它们属于他所属的项目)。然而,一个提要项目可能(并且将会)被许多用户看到。

我真的很想使用 CouchDB(主要是因为很酷的 _changes 提要和 map/reduce 视图)。我正在考虑将应用程序实现为纯 couchapp,但我在权限模型方面遇到了问题。AFAIK,CouchDB 中没有每个文档的权限,这通常使用每个用户的数据库和复制来实现。

但是,当不同用户看到的内容之间有很多重叠时,这会带来很多开销……东西会被复制到所有地方,并在许多数据库中复制。我喜欢这种方法的优雅,但巨大的开销感觉就像是一个交易破坏者......(假设我有 50 个用户,他们都看到相同的数据......)。

请问有什么办法吗?替代解决方案?

0 投票
4 回答
6099 浏览

shell - 如何知道给定用户是否对给定路径具有读取和/或写入权限

我应该首先说我认为自己是一个熟练的用户。但是今天我需要自动化这个并且被难住了。

假设我是 root,因此我能够遍历整个文件系统,但我不能运行“sudo”或“su”。

我有一个给定的用户和一个给定的路径。

如何通过 CLI 检查用户是否能够读取和/或写入路径?

我知道这听起来很容易,但请记住:

  • 我们不是,也不能成为用户。
  • 我们不能只依赖最终目录的权限,因为路径更高的权限可能会阻止对最终目录的访问。
  • 在这个继承组的时代,我们也不能仅仅依赖目录组权限。

我假设这不能通过任何命令完成,我需要首先收集所有用户组,然后遍历路径的整个层次结构,检查整个路径的读取权限,然后读取和写入最终目录。不过,听起来非常昂贵。

0 投票
3 回答
872 浏览

java - 存储用户访问权限的方法

我正在用 Java 创建一个应用程序(并使用 Mysql 作为 DBMS)。
我的应用程序。有用户,每个用户可以被允许或不允许应用程序的每个功能。有 8 种不同的静态权限。
如何为每个用户存储这些权限?
像 Unix 文件模式位(例如 0775)一样存储它是一个好主意吗?

谢谢

0 投票
2 回答
3596 浏览

permissions - Redmine 允许用户仅查看一个问题

我有一个 Redmine 安装,并且希望能够授予用户查看(并且可能更新)单个问题(不是项目中的所有问题)的能力。问题是该问题是由其他人报告的。

用例:用户 A、B 和管理员 C

  1. 管理员 C 创建两个错误报告 1 和 2
  2. 管理员 C 想要在 bug 1 上向用户 A 授予查看访问权限
  3. 管理员 C 想要在错误 2 上向用户 B 授予查看访问权限
  4. 用户 A 应该无法访问 bug2
  5. 用户 B 应该无法访问 bug1

这可以用Redmine完成吗?我一直在搞乱设置,但我没有看到一个简单的方法来完成这个用例。

如果没有,是否还有其他允许此类用例的错误跟踪器?

0 投票
1 回答
774 浏览

windows-7 - How to auto-upgrade program (Inno Setup) on windows 7 without being admin?

I use Inno setup to install python package (py2exe) on the program files folder. the first installation require admin privileged and it is ok.

The application has automatically upgrade option (it download the new setup exe ad run it in silence mode)

The problem is that it fails because the user is not admin.

My first though was to install the first installation in {pf} folder, but to install the updated pyc in the user folder. and somehow to tell the app to check for pyc in this folder. But I don't know how to do it and if it can be done

0 投票
2 回答
858 浏览

iphone - 在用户授权应用程序后解析 api 删除“您已经授权此应用程序”

我使用 parse.com 登录控制器将用户登录到 facebook。

如果用户在从 Facebook 获得“您已经授权此应用程序”之前授权了该应用程序。

有谁知道如何解决?

我使用的代码:

0 投票
1 回答
718 浏览

facebook - 用户和朋友权限未显示在身份验证对话框中

我对 Facebook Connect 功能非常陌生。我不知道它是否适合提出问题。我用 facebook 制作了一个应用程序,并请求了以下权限 user_about_me、user_birthday 和 user_hometown

当我单击“应用程序中的预览当前对话框” ->“测试应用程序”->“身份验证对话框”时,我只能看到“此应用程序将收到”“您的基本信息”。当我通过 facebook 登录我的应用程序时也是这种情况。但是当我点击“Preview Refferal Dialog”时,我在那里正确地看到了它。那么这两个对话框预览链接有什么区别呢?我应该怎么做才能让 Facebook 向我返回额外的数据?

顺便说一句,我正在使用 Facebook Javascript SDK。

谢谢并恭祝安康。