Esempio n. 1
0
        public override async Task <NullableIdDto <int> > CreateAsync(RoleCreateInput input)
        {
            CheckCreatePermission();

            var role = new Role(AbpSession.TenantId, input.Name, input.DisplayName)
            {
                IsDefault = input.IsDefault
            };

            CheckErrors(await _roleManager.CreateAsync(role));

            await CurrentUnitOfWork.SaveChangesAsync();

            var grantedPermissions = _permissionManager.GetAllPermissionsByNames(input.GrantedPermissions);

            await _roleManager.SetGrantedPermissionsAsync(role, grantedPermissions);

            return(ObjectMapper.Map <NullableIdDto>(null));
        }