Exemplo n.º 1
0
 public OrganizationUserInvite(OrganizationUserInviteRequestModel requestModel)
 {
     Emails      = requestModel.Emails;
     Type        = requestModel.Type.Value;
     AccessAll   = requestModel.AccessAll;
     Collections = requestModel.Collections.Select(c => c.ToSelectionReadOnly());
     Permissions = requestModel.Permissions;
 }
Exemplo n.º 2
0
        public async Task Invite(string orgId, [FromBody] OrganizationUserInviteRequestModel model)
        {
            var orgGuidId = new Guid(orgId);

            if (!_currentContext.ManageUsers(orgGuidId))
            {
                throw new NotFoundException();
            }

            var userId = _userService.GetProperUserId(User);
            var result = await _organizationService.InviteUserAsync(orgGuidId, userId.Value, null, new OrganizationUserInvite(model));
        }
Exemplo n.º 3
0
        public async Task Invite(string orgId, [FromBody] OrganizationUserInviteRequestModel model)
        {
            var orgGuidId = new Guid(orgId);

            if (!_currentContext.OrganizationAdmin(orgGuidId))
            {
                throw new NotFoundException();
            }

            var userId = _userService.GetProperUserId(User);
            var result = await _organizationService.InviteUserAsync(orgGuidId, userId.Value, model.Emails, model.Type.Value,
                                                                    model.AccessAll, null, model.Collections?.Select(c => c.ToSelectionReadOnly()));
        }
 public async Task Invite(string orgId, [FromBody] OrganizationUserInviteRequestModel model)
 {
     var userId = _userService.GetProperUserId(User);
     var result = await _organizationService.InviteUserAsync(new Guid(orgId), userId.Value, model.Email, model.Type.Value,
                                                             model.Subvaults?.Select(s => s.ToSubvaultUser()));
 }
Exemplo n.º 5
0
        public async Task Invite(string orgId, [FromBody] OrganizationUserInviteRequestModel model)
        {
            var user = await _userService.GetUserByPrincipalAsync(User);

            var result = await _organizationService.InviteUserAsync(new Guid(orgId), model.Email);
        }