database-permissions

django-guardian example source code

会有一股神秘感。 提交于 2019-12-13 13:18:30
问题 Can anyone suggest a good open source app that uses django-guardian? I'm not having trouble understanding the API, but I'd love to see an example to get a feel for implementation best practice (database design, etc.) 回答1: If you clone the django-guardian source code you have a working example of how to use it. And in this link are the instructions for integrating it with django admin 回答2: Django userena uses Django-guardian: https://github.com/bread-and-pepper/django-userena 来源: https:/

can a SQL Server stored proc execute with higher permission than its caller?

删除回忆录丶 提交于 2019-12-12 13:03:44
问题 Our SQL Server database has a reporting feature that allows callers to read, but not write, any table, because the user (or, more precise, the connection opened by the web app that's operating on behalf of the user) has only datareader permissions on the database. We'd like to be able to write a store procedure that is a special "cleanup report" that will scrub the DB of old cached data before running another report. We'd like the same read-only user above to be able to run this stored proc.

SQL Permissions to Add data and how to verify?

旧巷老猫 提交于 2019-12-12 09:15:10
问题 I'm looking for a good way to maintain permissions on who can add data to a database in a C# app and SQL Server 2005. I need to explain though to make this clear. So let's take an example of this: I have two users Bob and Jim , both have been added to the SQL permissions so they have write access to the database. Now all access is based on Domain User Accounts. All other users only have read access. Now I have a couple tables such as: Users UserPermissions Books BookPublishers So

PostgreSQL copy permissions from another table

我只是一个虾纸丫 提交于 2019-12-10 23:33:23
问题 Is it possible to copy the user permissions from one table in a PostgreSQL database to another table? Is it just a matter of updating the pg_class.relacl column value for the target table to the value for the source table, as in: UPDATE pg_class SET relacl=(SELECT relacl FROM pg_class WHERE relname='source_table') WHERE relname='target_table'; This seems to work, but am I missing anything else that may need to be done or other 'gotchas' with this method? Thanks in advance for any replies. 回答1

SQL Server: EXECUTE AS clause of stored procedure not granting sysadmin permissions

眉间皱痕 提交于 2019-12-10 20:31:48
问题 I developped a stored procedure in order to restore a database from a backup file and add an application user to it. This stored procedure belongs to the master database. The issue is that my IT department does not allow me to use an admin user, only to use an EXECUTE AS statement with a sysadmin user. I can restore the database but I can't find a way to add the user at the end of the process. The code I use: CREATE PROCEDURE [dbo].[myProc] @database VARCHAR(50) WITH EXECUTE AS 'aSysAdminUser

SQL Server 2005 - Granting permission to create stored procedures (but no other objects)

半腔热情 提交于 2019-12-10 16:33:21
问题 I want to grant a user permission to create, alter, and execute stored procedures, but without the ability to create other database objects. I excluded them from the role db_ddladmin, but explicitly granted the permissions "Create procedure" and "Execute". These permssions appear in the effective permissions list. However, when I try to create a stored procedure with this login, I get the following error: "The specified schema name "dbo" either does not exist or you do not have permission to

SQL Server: permissions to read database diagrams

帅比萌擦擦* 提交于 2019-12-10 15:16:02
问题 Could you please advise, what are permissions required to give user access to read Database diagrams in SQL Server 2005? Thanks a lot! 回答1: From BOL Although any user with access to a database can create a diagram, once the diagram has been created, the only users who can see it are the diagram's creator and any member of the db_owner role. Ownership of diagrams can only be transferred to members of the db_owner role. This is only possible if the previous owner of the diagram has been removed

CouchDB read/write restrictions on _users database

老子叫甜甜 提交于 2019-12-10 08:48:54
问题 I would like to restrict the user permissions so that a normal user is only able to read/write its own user document. I managed to set the write permissions such that a user can only edit their own document (via the validate_doc_update function in the design document). Now I only have to limit a user from viewing the user list or other user documents. If I set the database read permissions to the '_admin' role, then the user will not be able to view their own document, which it's not what I

Grant permissions to user for any new tables created in postgresql

时间秒杀一切 提交于 2019-12-09 08:39:00
问题 Currently I am using this to grant permissions: grant select on all tables in schema public to <user_name>; alter default privileges in schema public grant select on tables to <user_name>; According to the documentation, the second statement should have resolved the problem. It does not however auto grant permissions to user_name when a new table is added to the public schema. I am using this user (user_name) to copy data over to another database. 回答1: Found the answer. It is in this line in

Grant permission to only a view

喜欢而已 提交于 2019-12-07 14:29:38
问题 I have one user in my database, and I want to grant to him permission to read only one view, nothing more, no tables, nothing. How can I do this? Thanks a lot. P.S.: I am using MS SQL Server 2005 回答1: USE DB1; GRANT SELECT ON OBJECT:: View1 TO JohnDoe; GO Refer to GRANT Object Permissions for other examples of granting permission 回答2: Try this: GRANT SELECT ON whatever_your_view_is_called TO bob_or_whatever_his_name_is 回答3: This is fairly simple to do with the Enterprise Manager UI or using