Questions tagged [user-roles]

A user role is a group of users that share the same privileges or permissions on a system. Use this tag for questions about how user roles work in a particular security framework, or questions about the implementation of user roles in your program.

A user role is a group of users that share the same privileges or permissions on a system. For example, a blog platform may define a group of platform admins and groups of blog admins, blog editors and blog readers.

The concept is linked to , as a user role is a group of users who share common user permissions. It is common that a system allows users to have several roles, the user then has the union of all the permissions of their roles.

Use this tag for questions about how user roles work in a particular security framework, or questions about the implementation of user roles in your program.

944 questions
0
votes
1 answer

How to enable a custom post type to custom user role in WordPress

I have created a custom post type called Course Documents using WordPress Custom Post Type UI plugin. Also I have created a new user role called Teacher. add_role('rpt_teacher', 'Teacher', array( 'read' =>…
ashanrupasinghe
  • 758
  • 1
  • 10
  • 22
0
votes
1 answer

php page protected with roles but not agains guests

I am trying to protect some php pages with roles. The code i am using its working when the people make the login but if they know the link and don't make the login they can access the page and i can't understand why. Can anyone help me? I am using…
Osvaldo Cipriano
  • 313
  • 1
  • 2
  • 11
0
votes
1 answer

Add data into 2 entities with 1 form symfony 3

I have register form. When I save the user, i want to add row in other database table. The second table is for role and it has only 2 fields: user_id and role_id. This is my structure of database: CREATE TABLE `roles` ( `id` INT(11) NOT…
0
votes
1 answer

WP User role stays empty when making a new user with extern form

I am trying to make new Wordpress users using an extern form in a php-file. Leerling is dutch for student, and leerling is a role I created using a User Role Plugin. All the users that the form makes need to have the role leerling. I'm using the…
J. Valckx
  • 5
  • 1
0
votes
2 answers

Seed data to UserRole table .net core

I want to seed the default DB with an admin user before I start the project on .NET Core Default MVC application. The code is as below: public void SeedDb(ApplicationDbContext Context, IServiceProvider ServiceProvider, IConfiguration Configuration) …
0
votes
1 answer

Apply global scope based on user role in Laravel 5.5

For some model, I need to apply a global scope if the logged in user is not super admin. In model's boot() method I tried something like this:
0
votes
1 answer

SignInAsync in MVC ASP.net (User roles)

I got the following code working on my desktop. Currently I'm working on my laptop and this code just doesn't wanna work, it says that "SignInAsync" doesn't exist in the current context. [HttpPost] [AllowAnonymous] …
user8019468
0
votes
1 answer

How to edit user profile such as user role in Asp.Net Mvc?

I want to show user profile to my _EditUser view and then to edit user profile such as user role .. Name and Email. But when it comes to user role it's crashing. I get 500 (Internal Server Error) It is crashing here: model.ApplicationRoleId =…
Helen Tekie
  • 515
  • 1
  • 6
  • 23
0
votes
1 answer

Showing an input in a view depending on role

I have a fat view (add) with a lot of inputs (it's a form). For a role , there is a user_id input that is necessary, but for another role it isn't necessary. Here it comes my question, I know that elements are used for this kind of things, but I…
alfizqu
  • 158
  • 1
  • 16
0
votes
1 answer

How to insert secret question and answer using ASP.NET membership?

I am using asp.net membership for my web application.I need my users to choose their own secret question and answer in a separate page after their successful login. What is the method to insert the secret question and answer into database using…
Abilash
  • 113
  • 6
  • 16
0
votes
1 answer

UML:class model, user,role and relation with others class

I'm modeling a class model for a project and i'm a problem with member, statut (which is the role) and statut specialisation classes. As you can see in the pic i have specialise statut class to show that a specific role is able to do an action. But…
user8078820
0
votes
1 answer

Restrict product by role on WooCommerce

I need to lock some woocommerce products by category to enable purchasing for "shareholders" role only. How can I do so?
Evyatar Tal
  • 31
  • 1
  • 6
0
votes
1 answer

Dynamic Menu with roles in Symfony 3

I'm working for a project where the menu bar needs to be a dynamic menu interacting with the roles defined for the users. It works with the Symfony 3.3. The concept should be like this: '1' user have 'n' roles and each role should see 'm' options in…
0
votes
1 answer

Asp.Net Mvc Edit User profile with user Role

Why is my Action in Asp.Net Mvc code crashing when I want to get current user Role Name, when I want to edit user profile? This code is crashing model.ApplicationRoleId = roleManager.Roles.Single(r => r.Name ==…
Helen Tekie
  • 515
  • 1
  • 6
  • 23
0
votes
1 answer

Symfony 3.3.9 - app.user.roles doesn't get role_admin

i've a problem to get role_admin or role_user in twig. if {{ dump(app.user) }} then AND if {{ dump(app.user.roles) }} then Then {% if is_granted('ROLE_ADMIN') %} not working So, where is the problem ? Thanks.
J.Lucas
  • 9
  • 2