示例#1
0
        public async Task <IHttpActionResult> Create(SocialCreateModel social)
        {
            //if (!_permissionsService.Check(new PermissionSettingIdentity(PermissionActionEnum.Create, PermissionResourceTypeEnum.Social)))
            if (!await _socialService.CanCreateAsync(social.GroupId))
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            var mappedSocial = MapToSocial(social);

            var socialId = await _socialService.CreateAsync(mappedSocial);

            mappedSocial.Id = socialId;

            await OnBulletinCreatedAsync(mappedSocial, social);

            ReloadFeed();

            var result = await GetSocialViewModelAsync(socialId);

            return(Ok(result.Links.Details));
        }