<cite>alper: </cite> Can you open an issue on GitHub to make it changeable? <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new">https://github.com/aspnetboilerplate/as ... issues/new</a>
Ok,I will create an issue for it. Thanks
<cite>alper: </cite> yes, you're right. it's a const. did you try to run the tests without that change?
Not yet.Because of that AbpTenantBase.DefaultTenantName can't be changed from metadata,when I try to use seed method the default tenant gets created which I don't want to.I want to create a tenant with another name.Is it possible to do that?
<cite>alper: </cite> hi,
If you want to change the name "Default" for the default tenancy name.
- TenantConsts > DefaultTenantName = "MyDefault"
- AbpTenantBase > DefaultTenantName = "MyDefault"
- UserLinkAppService_Tests > LinkToUser() > TenancyName = "MyDefault"
we can't change the DefaultTenantName in AbpTenantBase as it is metadata file.How to do that?
<cite>ismcagdas: </cite> You can set it like below in the startup of your application
AbpClaimTypes.TenantId = "xxxxx";
But, don't set it to an empty string, otherwise it will cause some problems.
Thank you ismcagdas. Your help is really appreciated.I was struggling with this issue from 4 days but your help solved that problem in 1 hour.Thanks a lot :D
Thanks ismcagdas.
But can you tell me how can I remove that url part from tenant Id as AbpClaimTypes is of metadata type and it has 4 references.So where can I do that and how -
PrjName.Core\Authorization\Impersonation\ImpersonationManager.cs(55):
identity.AddClaim(new Claim(AbpClaimTypes.ImpersonatorTenantId, cacheItem.ImpersonatorTenantId.Value.ToString(CultureInfo.InvariantCulture)));
PrjName.Core\Authorization\Impersonation\ImpersonationManager.cs(58):
identity.AddClaim(new Claim(AbpClaimTypes.ImpersonatorUserId, cacheItem.ImpersonatorUserId.ToString(CultureInfo.InvariantCulture)));
PrjName..Core\Authorization\Users\UserLinkManager.cs(128):
identity.AddClaim(new Claim(AbpClaimTypes.ImpersonatorTenantId, cacheItem.ImpersonatorTenantId.Value.ToString(CultureInfo.InvariantCulture)));
PrjName.Core\Authorization\Users\UserLinkManager.cs(133):
My AbpClaimTypes class is like this -
public static class AbpClaimTypes
{
//
// Summary:
// UserId. Default: System.Security.Claims.ClaimTypes.Name
public static string UserName { get; set; }
//
// Summary:
// UserId. Default: System.Security.Claims.ClaimTypes.NameIdentifier
public static string UserId { get; set; }
//
// Summary:
// UserId. Default: System.Security.Claims.ClaimTypes.Role
public static string Role { get; set; }
//
// Summary:
// TenantId. Default: http://www.aspnetboilerplate.com/identity/claims/tenantId
public static string TenantId { get; set; }
//
// Summary:
// ImpersonatorUserId. Default: http://www.aspnetboilerplate.com/identity/claims/impersonatorUserId
public static string ImpersonatorUserId { get; set; }
//
// Summary:
// ImpersonatorTenantId Default: http://www.aspnetboilerplate.com/identity/claims/impersonatorTenantId
public static string ImpersonatorTenantId { get; set; }
}
Thanks @ismcagdas, I guess it will not grant any of the permissions for host user but, I want to remove only some permissions for host user, not all of them. So, is there something like we set some flag/parameter for permissions so that we can identify at the time of granting the permission which must be granted and which must be not.
I am actually thinking of overriding the CreateChildPermission() and set some flag, but I don't have the implementation of CreateChildPermission().
Thanks
That worked perfectly. Thanks @ismcagdas!
I just did a normal ng build. I did't add the --prod flag.
I am on the Latest version 5.0.6