[AbpException: There is no role with name: Admin]
See original GitHub issuei have a view for creating Tenant, in application service method i have a method that create tenant with admin role and user. i use role repository not role manager, when i try to login with the new created user , i got this exception
Abp.AbpException: There is no role with name: Admin
at Abp.Authorization.Roles.AbpRoleManager`3.<GetRoleByNameAsync>d__3d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.Roles.AbpRoleManager`3.<HasPermissionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Abp.Authorization.Users.AbpUserManager`3.<IsGrantedAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.Users.AbpUserManager`3.<IsGrantedAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.PermissionChecker`3.<IsGrantedAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Web.Authorization.AuthorizationScriptManager.<GetScriptAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown -
Issue Analytics
- State:
- Created 8 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
GetScripts Exception: There is no role with name
For our POST action in our AccountController for Login we want to currently limit authentication of users who have the role 'Administrator'.
Read more >Test fails asp.net boilerplate. Abp.AbpException : There is ...
When I run web.mvc project (of asp.net boilerplate template) the following exception is throwed: Abp.AbpException: There is no permission with ...
Read more >Implement "pro"modues in the microservicedemo #316
Exception: An error was encountered while handling the remote login. Volo.Abp.AbpException: There is already an existing permission group with name: AbpIdentity.
Read more >Spatie\Permission\Exceptions\RoleDoesNotExist There is ...
Spatie\Permission\Exceptions\RoleDoesNotExist There is no role named `super_admin`. Hi there, I don't what the problem is, I've added the guard to my model ...
Read more >ASP.NET Boilerplate authorization
The CreateUser method can not be called by a user who is not granted the permission "Administration.UserManagement.CreateUser". The AbpAuthorize attribute also ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue occurred again and I solved it by executing the following SQL to my database:
When you create a role manually it is necessary to call
role.SetNormalizedName()
, otherwise any GUID will be saved in the database and the permissions will not work.