database-permissions

Granting mysql access rights to all machines on subnet

喜欢而已 提交于 2019-12-04 14:50:58
I have a mysql instance (and schema) running on windows that I can access via a connection string based on localhost as the server. now I want to be able to access this db from another machine on the same subnet. If possible I would like to use a single user but allow it to access from any machine on the same subnet. how do I setup security for this? (I already opened the relevant firewall port) Thanks, Eyal You can do it like this: GRANT ALL PRIVILEGES ON mydb TO 'username'@'192.168.1.0/255.255.255.0'; change subnet and IP accordingly You can also use wildcards, rather than a masks. You can

Execute dynamic DDL in PL/SQL procedure through definer role permissions

独自空忆成欢 提交于 2019-12-04 11:10:55
I want to perform some dynamic DDL in a procedure owned by an admin user. I'd like to execute this procedure with a technical operational user with definer rights (operational user doesn't have the create table role). The problem is the 'create table' permission is granted to the admin user through use of a role, which doesn't allow me to execute the DDL as it seems that roles don't count in named pl/sql blocks. create or replace PROCEDURE test_permissions AUTHID DEFINER AS v_query_string VARCHAR2(400 CHAR) := 'CREATE TABLE TEST(abcd VARCHAR2(200 CHAR))'; BEGIN EXECUTE IMMEDIATE v_query_string

Efficiently determine owner of a record in a hierarchy with MongoDB

我们两清 提交于 2019-12-04 03:19:00
I am trying to achieve the following: Select all the records that I own, where ownership is objects I have created OR objects a user I manage has created, where user management can be in a hierarchy of users managing users Ownership is clearly straight forward and could be handled by a simple id corresponding to the owner. The hierarchy of user management has me a little stumped to perform without heavy lifting through large lists of IDs (you can obviously just find every user that is managed and list every object created by any of those users using an IN clause or similar). Ideally this all

TSQL - Executing CLR Permission

隐身守侯 提交于 2019-12-03 16:22:38
I got a sql procedure from a CLR (.net Assembly) that when executed returns an error Msg 6522, Level 16, State 1, Procedure sp_HelloWorld, Line 0 A .NET Framework error occurred during execution of user defined routine or aggregate 'sp_HelloWorld': System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. System.Security.SecurityException: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at

ASP.Net Membership.DeleteUser

十年热恋 提交于 2019-12-03 03:06:49
In testing, the user on a db i've used was a big jefe. In production, he only has Execute. When I called, Membership.DeleteUser(user) In testing, it worked. I try the same in production, and I get this: The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Us__UserI__37703C52". The conflict occurred in database "Testing", table "dbo.aspnet_UsersInRoles", column 'UserId'. In my seargles (searches on Google), I came across this link where the dude was saying, Error: The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Me__UserI__15502E78". The conflict

Permissions for truncating a table

别说谁变了你拦得住时间么 提交于 2019-12-01 02:39:21
What permission do I need to GRANT a user, in MSSQL, in order to be able to truncate a table? I'm trying to grant the minimal set of permissions, but I can't use DELETE, because the table is very large, and I want the operation to be quick. Shahar Mosek You need the ALTER permission: see the Permissions section here . Note that you can also use a stored procedure with EXECUTE AS, so that the user running the stored procedure does not need to even be granted the ALTER permission. The minimum permission required is ALTER on table_name. TRUNCATE TABLE permissions default to the table owner,

Permissions for truncating a table

試著忘記壹切 提交于 2019-11-30 21:22:52
问题 What permission do I need to GRANT a user, in MSSQL, in order to be able to truncate a table? I'm trying to grant the minimal set of permissions, but I can't use DELETE, because the table is very large, and I want the operation to be quick. 回答1: You need the ALTER permission: see the Permissions section here. Note that you can also use a stored procedure with EXECUTE AS, so that the user running the stored procedure does not need to even be granted the ALTER permission. 回答2: You can create a

Listing table results in “CREATE TABLE permission denied in database” ASP.NET - MVC4

筅森魡賤 提交于 2019-11-30 12:25:55
I'm using ASP.NET MVC 4 - c# to connect to a live database, and list the results, however when I go to view the page it returns the following error: CREATE TABLE permission denied in database 'DatabaseName'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database 'DatabaseName'. Source Error: Line 16: public ActionResult Index() Line 17: { Line 18: return

PHP Access Control System

眉间皱痕 提交于 2019-11-30 07:24:39
I am part of a team creating a web application using PHP and MySQL. The application will have multiple users with different roles. The application will also be used in a geographically distributed manner. Accordingly we need to create an access control system that operates at the following two levels: Controls user permissions for specific php pages i.e. provides or denies access to specific pages (or user interface elements) based on the user's role. For example: a user may be allowed access to the "Students" page but not to the "Teachers" page. Controls user permissions for specific database

Why did PostgreSQL merge users and groups into roles?

若如初见. 提交于 2019-11-30 06:31:09
问题 From the PostgreSQL docs: The concept of roles subsumes the concepts of "users" and "groups". In PostgreSQL versions before 8.1, users and groups were distinct kinds of entities, but now there are only roles. Any role can act as a user, a group, or both. Why did they make this change in 8.1? Perhaps it's easier from the C coders point of view, with a single Role class (struct)? More details: CREATE USER is equivalent to CREATE ROLE except that CREATE USER gives the LOGIN permission to the