roles

Best approach to user roles with an intranet application

天涯浪子 提交于 2019-12-03 16:36:29
I'm developing an ASP.NET MVC intranet website which needs to have a few different user roles (admin, editor, writer, etc.) and the backend uses SQL Server. I read this post by scottgu about role-based security and used that as a starting point. The steps I followed were: Configured a DB using the asp_regsql.exe application Set the authentication mode to windows <authentication mode = "Window" /> Added a connection string entry to the Web.config, <connectionStrings> <add name="SqlRoleManagerConnection" connectionString="Data Source=localhost; Initial Catalog=aspservicedb; Integrated Security

Wordpress add custom roles as well as remove default roles

大憨熊 提交于 2019-12-03 12:50:31
I need to customize the default roles as I need only 3 roles - administrator, buyer, seller . Then I need to add the buyer, seller and remove all other default roles. What should I do? If there is any ready made code which I can paste in and it will work? Paste this code in your themes function.php file and customize as your need. This is from my own code library. So it will definitely work. /* Add member role to the site */ add_role('member', 'Member', array( 'read' => true, 'edit_posts' => true, 'delete_posts' => true, )); /* Add snypher role to the site */ add_role('snypher', 'Snypher',

how to add roles to my users in rails app?

99封情书 提交于 2019-12-03 09:53:53
问题 I have a simple app with an authentication system from devise. I tried adding roles to the user model. But nothing happens. what i did was created the Role model and link it to the User Model: $ rails g model Role name:string $ rails g migration addRoleIdToUser role:references $ rake db:migrate (as directed by the devise wiki) Then in my Models: class User < ActiveRecord::Base belongs_to :role end class Role < ActiveRecord::Base has_many :users end Set up seeds.rb with my roles: ['seller',

Future of roles for GADT-like type variables?

泄露秘密 提交于 2019-12-03 08:42:36
问题 A question from yesterday had a definition of HList (from the HList package) that uses data families. Basically: data family HList (l :: [*]) data instance HList '[] = HNil newtype instance HList (x ': xs) = HCons1 (x, HList xs) pattern HCons x xs = HCons1 (x, xs) instead of the usual (IMO more elegant and intuitive) GADT definition data HList (l :: [*]) where HNil :: HList '[] HCons :: x -> HList xs -> HList (x ': xs) This is because the data family version lets us coerce (we only get to

Ansible - Define Inventory at run time

拟墨画扇 提交于 2019-12-03 08:13:56
I am liitle new to ansible so bear with me if my questions are a bit basic. Scenario: I have a few group of Remote hosts such as [EPCs] [Clients] and [Testers] I am able to configure them just the way I want them to be. Problem: I need to write a playbook, which when runs, asks the user for the inventory at run time. As an example when a playbook is run the user should be prompted in the following way: "Enter the number of EPCs you want to configure" "Enter the number of clients you want to configure" "Enter the number of testers you want to configure" What should happen: Now for instance the

How do you weave Authentication, Roles and Security into your DDD?

只谈情不闲聊 提交于 2019-12-03 07:01:17
问题 How do you implement Roles and Security in your C# Domain Driven Design projects? We have some debate raging on whether it should be implemented by the calling application (ASP.NET MVC) or in the Domain Model itself (model entities and services). Some argue that it should be in the web site itself since that's where the authentication already exists. But that means you have to re-implement security every time you integrate with the core business systems. As an example: an Admin should be able

“ERROR: must be member of role” When creating schema in PostgreSQL

大憨熊 提交于 2019-12-03 05:23:56
问题 I'm logged in with a superuser account and this is the process I'm doing: 1-> CREATE ROLE test WITH IN ROLE testroles PASSWORD 'testpasswd' 2-> CREATE SCHEMA AUTHORIZATION test The role is correctly created but I'm getting this error when trying to create the Schema: ERROR: must be member of role "test" Thanks in advance! 回答1: I ran into this issue when using CREATE DATABASE on Amazon RDS. I think it's essentially the same as using CREATE SCHEMA . When using Amazon RDS the user issuing the

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=

How to add Roles to Windows Authentication in ASP.NET Core

让人想犯罪 __ 提交于 2019-12-03 03:58:43
问题 I created an asp.net core project in visual studio 2015 with windows authentication. I can't figure out how to add roles to the Identity. I have a table with usernames for the windows account. And when the user opens the website the user is added to the Identity (I assume that's what happens, because I can display the username by User.Identity.Name) and I want to pull out Roles from another table and assign them to the user, is this possible? Or perhaps is there a better way to do it? (Why?,

Group and acl on Spring Security

安稳与你 提交于 2019-12-03 03:21:46
问题 I want to use Spring Security to manage user, group and permissions. I want to use ACL to secure my domain objects but I can't find a way to assign a group to an acl. For example: I've got users and groups. Each group can have the following securities: - manage forums (can be a role like ROLE_FORUM_MANAGER ) - edit a specific forum (acl on the specific forum). Moreover, Groups are defined by users which have role ROLE_PERMISSION_MANAGER . BUT all groups defined by this user can only be edited