Questions tagged [roles]

In various access control systems, roles define a group of users and organize permissions into a more manageable structure.

In various systems, roles define a group of users and organize permissions into a more manageable structure. In systems which feature roles, a user may belong to many roles, and typically roles can be nested hierarchically.

Roles are a common feature in operating systems as well as database management systems.

Further Reading

3030 questions
18
votes
7 answers

Ansible best practice do not repeat common role

On the Ansible best practices page: http://docs.ansible.com/ansible/playbooks_best_practices.html#top-level-playbooks-are-separated-by-role it shows an example where the master playbook site.yml includes a couple of other top-level playbooks…
user1087973
  • 800
  • 3
  • 12
  • 29
18
votes
2 answers

HttpContext.GetOwinContext().GetUserManager() return null

I've used ASP.NET Identity 2 for creating role but the result of HttpContext.GetOwinContext().GetUserManager() was null. Then I couldn't create the role. How can I solve this problem? public class MVCController : Controller { …
x19
  • 8,277
  • 15
  • 68
  • 126
18
votes
5 answers

Get all users with role in Laravel

I'm working in this Laravel project which has this structure users: id | first_name |... roles: id | name assigned_roles: id | user_id | role_id I think this is quite obvious :p User model class User extends ConfideUser { use HasRole; public…
jdfauw
  • 647
  • 3
  • 11
  • 22
18
votes
4 answers

How do I manually set a user's role in ASP.NET MVC?

This project I'm working on requires me to keep a local db of admin users and use an external db for regular users. Anyone who passes authentication in the admin db should be assigned the 'admin' role, and anyone authenticated through the other db…
Colin O'Dell
  • 8,386
  • 8
  • 38
  • 75
17
votes
5 answers

No service for type Identity.UserManager when using multiple identity users

My setup Currently, I have two models that inherit from ApplicationUser, which inherits IdentityUser. The user classes are: public abstract class ApplicationUser : IdentityUser { [PersonalData] public string FirstName { get; set; } …
Matthijs
  • 2,483
  • 5
  • 22
  • 33
17
votes
3 answers

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

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…
17
votes
9 answers

Common CMS roles and access levels

I am currently writing a CMS and remember someone (it might have been on here) criticise the existing CMS for not having a robust enough user permissions system. I've got a method planned out but it I feel it has fallen into the usual trap of being…
Meep3D
  • 3,803
  • 4
  • 36
  • 55
16
votes
2 answers

Dynamic roles and permissions system in Rails app

I need to create roles based permissions systems in my Rails app. I would be totally happy with CanCan, but the main problem - it has to be dynamic, so that Admin has to be able to assign permissions and to create new roles. The permissions can be…
alony
  • 10,725
  • 3
  • 39
  • 46
16
votes
8 answers

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

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…
devforall
  • 7,217
  • 12
  • 36
  • 42
16
votes
2 answers

Two owners of the same PostgreSQL database

Is it possible with Postgresql to create a database which has 2 users which act like owners to the database? I can create a group role and add both users to that group, and then make the group the owner of the database, but this requires both users…
David Reynolds
  • 3,141
  • 3
  • 18
  • 19
16
votes
1 answer

Simple custom roles for windows authentication in asp. net?

At our company network, the roles in Active Directory(AD) are not appropriately assigned for my application. So I created a simple table in my database mapping all the users in the AD and their roles. There is literally only two columns in this…
Bonk
  • 1,859
  • 9
  • 28
  • 46
15
votes
4 answers

Built-in database role in SQL Server 2005 to permit execution of stored procedures?

In SQL Server 2005, there are built in roles: db_datareader db_datawriter etc. Is there any role that lets a user execute an stored proc? I don't want to use db_owner, because that will permit deletion and updates, which I don't need. The only…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
15
votes
7 answers

unable to add roles to user with meteor using 'roles' package

I'm trying to use the 'roles' package available on Atmosphere but I can't get it to work with Accounts.onCreateUser(), I can get the example on github. When I register a user, I want to add a role to them, when I test whether the role is assigned,…
user1627990
  • 2,587
  • 2
  • 16
  • 18
15
votes
5 answers

Find all users with specific role using rolify

How can i get all users with specific role when using rolify? I've tried the following but it didn't help: User.with_role :admin I get the following error: NoMethodError: undefined method `with_role' for # Couldn't find…
roman
  • 5,100
  • 14
  • 44
  • 77
14
votes
2 answers

Granting Full SQL Server Permissions for a Database

How can I give a user (who was created WITHOUT LOGIN) full control over a contained database without having to specify that database's name, like GRANT CONTROL ON DATABASE::DatabaseName TO UserName, but without using a database name? I figure it'll…
uncaged
  • 597
  • 1
  • 5
  • 17