role

ASP.NET Core - custom AspNetCore.Identity implementation not working

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm building a completely custom AspNetCore.Identity Implementation because I want TKey to be System.Guid across the board. With respect, I have derived types for... Role : IdentityRole<Guid, UserRole, RoleClaim> RoleClaim : IdentityRoleClaim<Guid> User : IdentityUser<Guid, UserClaim, UserRole, UserLogin> UserClaim : IdentityUserClaim<Guid> UserLogin : IdentityUserLogin<Guid> UserRole : IdentityUserRole<Guid> UserToken : IdentityUserToken<Guid> ApplicationDbContext : IdentityDbContext<User, Role, Guid, UserClaim, UserRole, UserLogin,

PostgreSQL error: Fatal: role “username” does not exist

匿名 (未验证) 提交于 2019-12-03 02:18:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm setting up my PostgreSQL 9.1. I can't do anything with PostgreSQL: can't createdb , can't createuser ; all operations return the error message Fatal : role h9uest does not exist h9uest is my account name, and I sudo apt-get install PostgreSQL 9.1 under this account. Similar error persists for the root account. 回答1: You probably need to use the system user postgres to create your database - as long as you haven't set up (and given the necessary privileges to) a database user named "h9uest" that corresponds to your system user of

How many roles can you have per Azure instance

匿名 (未验证) 提交于 2019-12-03 02:18:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know that you can only have 1 web role per instance but does this apply to Background roles as well? In more detail can 1 instance run a background role and a web role? 回答1: I think the terminology used in your question is confusing the other responders. In Windows Azure compute, you have a cloud service. A cloud service can be thought of as your overall architecture, or at least the front end, the middle tier, etc (any tier where there is compute as opposed to storage). For example your application might have a presentation front end (ASP

Rails idiom to avoid duplicates in has_many :through

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a standard many-to-many relationship between users and roles in my Rails app: class User < ActiveRecord::Base has_many :user_roles has_many :roles, :through => :user_roles end I want to make sure that a user can only be assigned any role once. Any attempt to insert a duplicate should ignore the request, not throw an error or cause validation failure. What I really want to represent is a "set", where inserting an element that already exists in the set has no effect. {1,2,3} U {1} = {1,2,3}, not {1,1,2,3}. I realize that I can do it

How can I create a view that has different displays according to the role the user is in?

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create a view that has different displays according to the role the user is in. Should I create a different view for different roles or should I check the roles on the Veiw page itself rather than in the actions? How would I check the role on the view page? 回答1: Or should i use check the roles on the Veiw page its self rather than on actions, if so can someone plz show me how do check that on view page You need to do both. Check roles on actions as a security measure and check roles on views to enable/disable specific controls.

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

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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

psql: FATAL: role “postgres” does not exist

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm a postgres novice. I installed the postgres.app for mac. I was playing around with the psql commands and I accidentally dropped the postgres database. I don't know what was in it. I'm currently working on a tutorial: http://www.rosslaird.com/blog/building-a-project-with-mezzanine/ And I'm stuck at sudo -u postgres psql postgres ERROR MESSAGE: psql: FATAL: role "postgres" does not exist $ which psql /Applications/Postgres.app/Contents/MacOS/bin/psql This is what prints out of psql -l List of databases Name | Owner | Encoding | Collate |

Store/assign roles of authenticated users

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am upgrading a site to use MVC and I am looking for the best way to set up Authentication. At this point, I have the log-in working off of Active Directory: validating a username and password, and then setting the Auth cookie. How do I store the user's role information at time of log-in, in order for my controllers to see those roles as the user navigates through the site? [Authorize(Roles = "admin")] I have no problem getting a list of roles from Active Directory. I just don't know where to put them so that the controllers will see them.

How to create multiple threads in Windows azure worker role

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to do multiple operations in a single worker role. How to create threads in worker role? 回答1: You could add multiple workers in the WorkerRole::OnStart() as described here http://www.31a2ba2a-b718-11dc-8314-0800200c9a66.com/2010/12/running-multiple-threads-on-windows.html public class WorkerRole : ThreadedRoleEntryPoint { public override void Run () { // This is a sample worker implementation. Replace with your logic. Trace . WriteLine ( "Worker Role entry point called" , "Information" ); base . Run (); } public override

AccessDeniedException if using RoleHierarchyImpl

匿名 (未验证) 提交于 2019-12-03 02:01:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using role hierarchy in Spring Security. ROLE_USER > ROLE_GUEST I am securing methods using protect-pointcut However, I got AccessDeniedException if I login with user that has authority ROLE_USER. I have no issue if I specified protect-pointcut with access="ROLE_GUEST,ROLE_USER" . Am I missing some steps? FYI, I am using Spring 3.0.5. Thanks. 回答1: Have a look at bug report SEC-1163 and the comment below. If you want basic support for role hierarchies, then use a RoleHierarchyVoter, instead of a RoleVoter. So you need somethink like: 回答2