예제 #1
0
        /// <summary>
        /// 添加角色同时关联组织
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        //[Authorize(IdentityPermissions.Roles.Create)]
        //[Authorize(TigerIdentityPermissions.Roles.AddOrganizationUnitRole)]
        public virtual async Task <IdentityRoleDto> CreateAsync(IdentityRoleOrgCreateDto input)
        {
            var role = await base.CreateAsync(
                ObjectMapper.Map <IdentityRoleOrgCreateDto, IdentityRoleCreateDto>(input)
                );

            if (input.OrgId.HasValue)
            {
                await _orgManager.AddRoleToOrganizationUnitAsync(role.Id, input.OrgId.Value);
            }
            return(role);
        }
 public Task <IdentityRoleDto> CreateAsync(IdentityRoleOrgCreateDto input)
 {
     return(RoleAppService.CreateAsync(input));
 }