title: SwiftUi CloudKit Record Modify Failed to Save "WRITE operation not permitted"
body: <p>I cant seem to get certain records to modify in my public database. The error is</p>
  <blockquote>
  <p>Error saving record &lt;CKRecordID: XXXXXXX; recordName=XXXXXX, zoneID=_defaultZone:<strong>defaultOwner</strong>&gt; to server: WRITE operation not permitted</p>
  </blockquote>
  <p>I don't understand why it says &quot;Write not permitted&quot; because I have all the correct Security Roles checked off in the dashboard. I also confirmed that it is signed into Icloud before I try to modify the record.</p>
  <p>This is the relevant code:</p>
  <pre><code>// MARK: - Modify Updates in Cloudkit
  static func modifyUpdates(item: pushNote, completion: @escaping (Result&lt;pushNote, Error&gt;) -&gt;
      ()) {
      guard let recordID = item.recordID else { return }
      CKContainer.default().publicCloudDatabase.fetch(withRecordID: recordID) { (record, err) in
          DispatchQueue.main.async {
              if let err = err {
                  completion(.failure(err))
                  return
              }
              guard let record = record else { return }
              
              
              record[&quot;updates&quot;] = item.updates as CKRecordValue
              
              CKContainer.default().publicCloudDatabase.save(record) { (record, err) in
                  DispatchQueue.main.async {
                      if let err = err {
                          completion(.failure(err))
                          return
                      }
                      guard let record = record else { return }
                      let id = record.recordID
                      guard let updts = record[&quot;updates&quot;] as? [String] else { return }
                      guard let boss = record[&quot;bossID&quot;] as? String else { return }
                      
                      let element = pushNote(recordID:id, bossID: boss, updates : updts)
                      completion(.success(element))
                  }
              }
          }
      }
  }
  </code></pre>