<p dir="auto">This PR makes Geany switch documents to read-only mode when the files being opened do not have write permission.  This will prevent the user from making changes that cannot later be saved.  If the document is saved with a different name, read-only mode will be turned off.  The document can also be manually switched out of read-only mode from the Documents menu.</p>
<p dir="auto"><code>g_access()</code> is used to check permissions.  On Windows, it does not do a full permissions check, so files the user does not have permissions to change may still be opened in normal editing mode.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/geany/geany/pull/2989'>https://github.com/geany/geany/pull/2989</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/geany/geany/pull/2989/commits/4917d296bf31b128276a5a0dd1e1d2aded61a431">Open files without write permission as read only</a></li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/geany/geany/pull/2989/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/geany/geany/pull/2989/files#diff-90e39f5f0dfc1344b1b22db34414d3623c2d53cfedcb89e870e24fbb55c93d36">src/document.c</a>
    (5)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/geany/geany/pull/2989.patch'>https://github.com/geany/geany/pull/2989.patch</a></li>
  <li><a href='https://github.com/geany/geany/pull/2989.diff'>https://github.com/geany/geany/pull/2989.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/2989">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ6UTBQSHITLY64M7ODULAAAFANCNFSM5HTFZHLA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ2X7LJW7W2Q76MKVBTULAAAFA5CNFSM5HTFZHLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PTSTYGQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/2989",
"url": "https://github.com/geany/geany/pull/2989",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>