public async Task <string> Share(string doneeName, string path) { var userName = await GetLoggedUserName(); await _resourceAccessService.ShareAccessToResourceAsync(doneeName, userName, path); return("OK"); }
public async Task RegisterUserAsync(string userName, string password) { var user = await _dbContext.Users.SingleOrDefaultAsync(x => x.UserName == userName); if (user != null) { throw new MiniCloudException("User with this name already exists"); } user = new User(userName, password); await _dbContext.Users.AddAsync(user); _directoryService.CreateUserDirectory(userName); await _dbContext.SaveChangesAsync(); await _resourceAccessService.ShareAccessToResourceAsync(userName, userName, ""); }