hi
2.
You can use RolePermissionValueProvider.ProviderName as the Provider of a permission definition. You can't use Roles.Admin and Roles.Workshop.Owner.
group.AddPermission("MyPermission6").WithProviders(RolePermissionValueProvider.ProviderName);
If you want to grant permissions to a role, you don't need to do this.
You can use:
await permissionManager.SetForRoleAsync("your_role_name", TestPermissionNames.MyPermission1, true);
hi
Table 'timesheet_dev.abppermissiongroups' doesn't exist
Does the abppermissiongroups table exist on your database?
Are you using the same version of abp for all of your websites?
Can you share a project to reproduce this error?
We must look at the code or the project to troubleshoot the problem.
Your ticket has been refunded.
hi
I checked. This is a problem with CLI, I will fix it.
You can upgrade your nuget and npm package manually.
Thanks. I'm checking this.
hi
We will improve this case. Thanks.
hi
private void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.AddAuthorization(options =>
{
options.DefaultPolicy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.AddRequirements(new DenyExternalUserAuthorizationRequirement()).Build();
});
}
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
namespace MyCompanyName.MyProjectName.Web;
public class DenyExternalUserAuthorizationRequirement : AuthorizationHandler<DenyExternalUserAuthorizationRequirement>, IAuthorizationRequirement
{
protected async override Task HandleRequirementAsync(AuthorizationHandlerContext context, DenyExternalUserAuthorizationRequirement requirement)
{
// Do your check.
// if (context.User is ExternalUser)
// {
// context.Fail();
// }
context.Succeed(requirement);
}
}
hi
There was a problem with our Nuget website yesterday. It has been fixed now. Can you try again?
If still not work for you , can you share a project to reproduce the NuGet error
Thanks.
hi
I'd be happy to provide an answer. :)
how I can remove the permission groups in either document you have suggested so far.
You can try to remove the permission group from your PermissionDefinitionProvider.
public class MyProjectNamePermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var myGroup = context.AddGroup(MyProjectNamePermissions.GroupName);
//Define your own permissions here. Example:
//myGroup.AddPermission(MyProjectNamePermissions.MyPermission1, L("Permission:MyPermission1"));
// var identityGroup = context.GetGroupOrNull(IdentityPermissions.GroupName);
// if (identityGroup != null)
// {
// context.RemoveGroup(identityGroup.Name);
// }
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<MyProjectNameResource>(name);
}
}
hi
try use repository which provides ABP so GetAsync, GetListAsync, FindAsync etc methods.
Please share the code of your blazor component.
Thanks.