role

role_hierarchy with Symfony2

大兔子大兔子 提交于 2019-12-03 05:21:39
问题 I have a big problem with my role_hierarchy, security: role_hierarchy: ROLE_ADMIN:[ROLE_USER,ROLE_AUTHOR,ROLE_MODERATOR] ROLE_SUPER_ADMIN:[ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH] with that, if i got the SUPER_ADMIN role, I will got the ROLE_AUTHOR, ROLE_MODERATOR, ROLE_USER AND ROLE_ADMIN. But my problem it's when I login on my website, if I check the profiler, i can see i got only the ROLE_SUPER_ADMIN, not the others roles, so, can you help me? my view ( base.html.twig ) <h3>Blog</h3> <ul class=

Laravel - How to get Entrust Roles of a specific user

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm making a small work with Laravel and using Zizaco Entrust . While logged in as Administrator I want to see all Roles of a specific user. I'v searched for a while but didn't find any clue... How can I do it using Entrust or shall I use SQL queries? 回答1: In your User class add public function roles () { return $this -> belongsToMany ( 'Role' , 'assigned_roles' ); } Then you can get all roles for a specific user $user = User :: with ( 'roles' )-> find ( 1 ); $roles = $user -> roles ; 回答2: If you are using Zizaco\Entrust you don't

How to get users based on role?

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How could users in a "customer" role be retrieved from a MembershipUserCollection? 回答1: Roles.GetUsersInRole returns a string[] of user names in a role. If you really want the MembershipUser objects, you can use: var list = Roles.GetUsersInRole("roleName").Select(Membership.GetUser).ToList() Of course, this is performance intensive as it hits the database once for every user. If you are willing to give up provider-independence, you can query the underlying database directly and perform a join on the database server to get all users in a

HQL: Hibernate query with ManyToMany

匿名 (未验证) 提交于 2019-12-03 03:05:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a question with HQL query and hibernate. I have a user class and a role class. A user can have many roles. So I have a ManyToMany relatation like this: In user class: @ManyToMany(fetch = FetchType.LAZY) @oinTable(name = "PORTAIL_USERROLE", joinColumns = { @JoinColumn(name = "USERID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "ROLE", nullable = false, updatable = false) }) public Set<Portailrole> getPortailroles() { return this.portailroles; } In role class: @ManyToMany(fetch = FetchType.LAZY)

How do I remove an existing claim from a ClaimsPrinciple?

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am making a developer tool for impersonating Roles for an intranet site to allow developers to quickly act as any Role as needed. Roles defined are Developer, Team Lead, Team Member, Engineering, Marketing, Guest and a tool on the web page makes a call to a Web Api to add or remove the Claim ... well I can add but can't seem to find out where the .RemoveClaim(claim) or .TryRemoveClaim(claim) can be accessed to get this working. Do I have to create a custom claims manager to get this functionality or am I missing something? I have

Does Windows Azure have anything readily available against denial of service attacks?

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We're developing a web service hosted in Windows Azure. We expect that at some moments bad guys try to DDOS it. I Googled and didn't find anything new and definitive ( this one is rather vague) about whether Windows Azure has some features against denial of service attacks. Do we need any special measures? What does Windows Azure offer to protect against denial of service attacks? 回答1: The Azure load balancer provides some protection, but the details of this are not published. 回答2: I reckon no one service provider could truly have a feature

Rails - How to declare attr_accessible for multiple roles without duplication

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to declare attr_accessible for multiple roles without a ton of duplication? If I have several user roles, and each role is allowed to edit a different subset of attributes, here's what my attr_accessible declaration looks like: attr_accessible :first_name, :last_name, :active, :as => :admin attr_accessible :first_name, :last_name, :as => :manager attr_accessible :first_name, :last_name, :as => :guest I'd like to either A) define an array of accessible attributes that can be shared among different roles or B) define an array of

Role Management in ASP MVC 5 (Microsoft.AspNet.Identity)

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: in ASP MVC5 RC I didn't get the role system to work. My database has all needs tables an role exist but proofing if user is in role always return false (no SQL exception or something)!? Did I need to activate role system for IPrincipal somewhere? Test code: AccountController accCont = new AccountController(); // check role exist : result = true var roleExist = await accCont.IdentityManager.Roles.RoleExistsAsync("61c84919-72e2-4114-9520-83a3e5f09de1"); // try find role by name : result = role object var role = await accCont.IdentityManager

Restricting users from accessing pages by directly changing the URL in JSF

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have two kinds of users in my application - clients and sellers. I am using a PhaseListener in JSF to prevent users from accessing pages without logging in, but after they are logged in I dont know how to prevent the user from change the URL in the location bar and accessing pages that he is not allowed too. E.g, preventing clients from accessing sellers pages. Does anyone have an idea on how I could prevent such illegal accesses? 回答1: Assign the user a group/role and check on that as well inside your phase listener (which could

psql fatal role does not exist

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently the lastest version of ubuntu and i'm not used to it yet. I had several problems connecting postgresql with pgadmin3. I tryed to follow several tutorials to create a localhost server which I can use in pgadmin3. I didn't really hit the mark and I think I made it worse by installing, uninstalling, installing, uninstalling, trying answers I found... At this point I'm not sure my postgres is clean. It could be possible that I have two postgres installed, once again, I'm not sure. I tryed to uninstall it but I had an error which