role

pg_dump vs pg_dumpall? which one to use to database backups?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried pg_dump and then on a separate machine I tried to import the sql and populate the database, I see CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist CREATE TABLE ERROR: role "prod" does not exist ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE ALTER TABLE WARNING: no privileges could be revoked for "public" REVOKE ERROR: role "postgres" does not exist ERROR: role "postgres" does not exist WARNING: no privileges were

MongoDB what are the default user and password?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using the same connection string on local and production. When the connection string is mongodb://localhost/mydb What are the user and password ? Is it secure to keep it this way ? 回答1: By default mongodb has no enabled access control, so there is no default user or password. To enable access control, use either the command line option --auth or security.authorization configuration file setting. You can use the following procedure or refer to Enabling Auth in the MongoDB docs. Procedure Start MongoDB without access control. mongod -

ASP.NET, how to manage users with different types of roles

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create a website with various users. The users can have different roles, admin and user, which is a very well documented situation. But I would like to also group the users on their location, so at each location I can have both admins and users. - A multi dimensional role system? The reason is, that users in Germany should have access to a certain set of documents, while the Italian users shouldn't. Where should I look for documentation on this specific topic? I need some way to limit my search, maybe some keywords. 回答1: A

ASP.NET Core Identity 2.0 Authorize filter

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've a controller that I want to restrict only to a specific role, let's say admin . After setting a user with the admin role, I can validate that he's on that role using the IsInRoleAsync method (which returns true). When setting the attribute with [Authorize(Roles = "admin")] I get a 404 with that very same user . I'm using bearer tokens (I don't think that is relevant but anyway) and here's what I've done to try debugging: Controller w/o [Authorize] : the resource is returned. [OK] Controller with [Authorize] : the resource is returned

Rails : Adding an admin role using devise who can see all the users

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to create an admin role using devise for my app. I've created basic authentication using devise . I have a devise user model in my app but now i need an admin who can show edit and destroy all the users. I tried following the tutorials but none of them helped. I am using rails 3.0.10 and ruby 1.9.2-p290. 回答1: You just define role.rb first by creating migratioin rails g model role name:string then in role.rb class Role has_one:user end And in user model class user belongs_to :role end Insert two roles into DB 1.admin 2.user Then check

Spring Data Neo4J @Indexed(unique = true) not working

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to Neo4J and I have, probably an easy question. There're NodeEntitys in my application, a property (name) is annotated with @Indexed(unique = true) to achieve the uniqueness like I do in JPA with @Column(unique = true). My problem is, that when I persist an entity with a name that already exists in my graph, it works fine anyway. But I expected some kind of exception here...?! Here' s an overview over basic my code: @NodeEntity public abstract class BaseEntity implements Identifiable { @GraphId private Long entityId; ... } public

The EXECUTE permission was denied on the object 'xxxxxxx', database 'zzzzzzz', schema 'dbo'

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm having problems executing a function. Here's what I did: Create a function using SQL Server Management Studio. It was successfully created. I then tried executing the newly created function and here's what I get: The EXECUTE permission was denied on the object 'xxxxxxx', database 'zzzzzzz', schema 'dbo'. 回答1: Sounds like you need to grant the execute permission to the user (or a group that they a part of) for the stored procedure in question. For example, you could grant access thus: USE zzzzzzz; GRANT EXEC ON dbo.xxxxxxx TO PUBLIC 回答2:

jOOQ can I fetch a join of two tables into the respective POJOs

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In jOOQ if I want to fetch a row of a table into a jOOQ autogenerated POJOs I do, for instance: dsl . selectFrom ( USER ) . where ( USER . U_EMAIL . equal ( email )) . fetchOptionalInto ( User . class ); Now, suppose that I want to do a join between two tables, e.g. USER and ROLE , how can I fetch the result into the POJOs for these two tables? 回答1: This is one solution using ResultQuery.fetchGroups(RecordMapper, RecordMapper) Map < UserPojo , List < RolePojo >> result = dsl . select ( USER . fields ()) . select ( ROLE . fields ())

ERROR: permission denied for relation tablename on Postgres while trying a SELECT as a readonly user

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; The readonly user can connect, see the tables but when it tries to do a simple select it gets: ERROR: permission denied for relation mytable SQL state: 42501 This is happening on PostgreSQL 9.1 What I did wrong? 回答1: Here is the complete solution for PostgreSQL 9+, updated recently. CREATE USER readonly WITH ENCRYPTED PASSWORD 'readonly'; GRANT USAGE ON SCHEMA public to readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; -- repeat code below for each

How to pivot in SQL

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am not sure if this would be called pivoting. Data in my SQL 2005 table [CustromerRoles] is as such: CustId RoleId 2 4 2 3 3 4 4 1 4 2 [Roles] table: RoleId Role 1 Admin 2 Manager 3 Support 4 Assistant I want to create a view such that: SELECT * FROM [MYVIEW] will give me the data below: The 1 & 0's will be bits so that I can display a grid with checkboxes on my UI display. CustId Admin Manager Support Assistant 2 0 0 1 1 3 0 0 0 1 4 1 1 0 0 So far I have no idea how to go about doing this. 回答1: Try this: SELECT CustId, SUM(ISNULL(Admin,0)