Revision 8f44fd3a trunk/Pithos.Core/Agents/Uploader.cs

b/trunk/Pithos.Core/Agents/Uploader.cs
47 47
                        return;
48 48
                    }
49 49

  
50
                    var latestState = action.FileState;
51

  
50 52
                    //Do not upload files in conflict
51
                    if (action.FileState.FileStatus == FileStatus.Conflict)
53
                    if (latestState.FileStatus == FileStatus.Conflict)
52 54
                    {
53 55
                        Log.InfoFormat("Skipping file in conflict [{0}]", fileInfo.FullName);
54 56
                        return;
55 57
                    }
56 58
                    //Do not upload files when we have no permission
57
                    if (action.FileState.FileStatus == FileStatus.Forbidden)
59
                    if (latestState.FileStatus == FileStatus.Forbidden)
58 60
                    {
59 61
                        Log.InfoFormat("Skipping forbidden file [{0}]", fileInfo.FullName);
60 62
                        return;
......
85 87
                            var cloudInfo = client.GetObjectInfo(account, cloudFile.Container, cloudFile.Name);
86 88

  
87 89
                            //If this is a read-only file, do not upload changes
88
                            if (cloudInfo.AllowedTo == "read")
90
                            if (!cloudInfo.IsWritable(action.AccountInfo.UserName))
89 91
                                return;
90 92

  
91 93
                            if (fileInfo is DirectoryInfo)
......
139 141
                            if (response.StatusCode == HttpStatusCode.Forbidden)
140 142
                            {
141 143
                                StatusKeeper.SetFileState(fileInfo.FullName, FileStatus.Forbidden, FileOverlayStatus.Conflict, "Forbidden");
144
                                
142 145
                            }
143 146
                            else
144 147
                                //In any other case, propagate the error

Also available in: Unified diff