Example #1
0
        async public Task<IActionResult> FolderAddAuthorizedUser([FromBody] ghostlight.Shared.AuthorizedUser user, string folderId)
        {
            var authorizedUser = new Entities.AuthorizedUser()
            {
                Email = user.Email,
                FolderId = folderId
            };
            _db.AuthorizedUsers.Add(authorizedUser);
            await _db.SaveChangesAsync();

            return Ok(authorizedUser.ToSharedAuthorizedUser());
        }
Example #2
0
        static public Shared.AuthorizedUser ToSharedAuthorizedUser(this Entities.AuthorizedUser model)
        {
            var authorizedUser = new Shared.AuthorizedUser()
            {
                Id            = model.Id,
                Email         = model.Email,
                Administrator = model.Administrator,
                Write         = model.Write,
                Read          = model.Read,
                Delete        = model.Delete
            };

            return(authorizedUser);
        }