<div dir="ltr">Ohhh That's simple. :-)<div style>Thanks a lot Jan. </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 4, 2013 at 2:55 PM, Jan Brenner <span dir="ltr"><<a href="mailto:jan@brennerpack.de" target="_blank">jan@brennerpack.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div>
<p style>Hi Sampath,</p><p style>that's simple. You know the possible permissions and the corresponding numeric values. The numeric values are "powers of two".</p><p style>READ = 2^0</p><p style>UPDATE = 2^1</p>
<p style>CREATE = 2^2</p><p style>...</p><p style>A permission-set is the sum of these values.</p><p style>Examples:</p><div class="im"><p style>*When I share a file <font color="#ff0000">with both Delete permission and Update permission</font>, then value of the permission column is <font color="#ff0000"><b>11</b></font>.</p>
</div><p style>--> 8 (DELETE) + 2 (UPDATE) + 1 (READ) = 11</p><div class="im"><p style>*When I share a file <font color="#ff0000">with only share permission</font> (only 'share' check box is checked), then value of the permission column is <font color="#ff0000"><b>17</b></font></p>
</div><p><font>--> 16 (SHARE) + 1 (READ) = 17</font></p><p>Best</p><p>Jan</p><blockquote style="padding-left:5px;margin-right:0px;border-left-color:rgb(50,95,186);border-left-style:solid;margin-left:5px;border-left-width:2px">
-----Ursprüngliche Nachricht-----<br><strong>Von:</strong> Sampath Basnagoda <<a href="mailto:sampathbasnagoda@gmail.com" target="_blank">sampathbasnagoda@gmail.com</a>><br><strong>Gesendet:</strong> Die 4 Juni 2013 10:52<br>
<strong>An:</strong> <a href="mailto:owncloud@kde.org" target="_blank">owncloud@kde.org</a><br><strong>Betreff:</strong> Re: [Owncloud] [OwnCloud] ownCloud file permission structure<div><div class="h5"><br><br>
<div dir="ltr">Can Somebody please help me with this? <div>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 4, 2013 at 1:22 AM, Sampath Basnagoda <span dir="ltr"><<a href="mailto:sampathbasnagoda@gmail.com" title="Der externe Link wird in einem neuen Fenster geöffnet" target="_blank">sampathbasnagoda@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div>I'm developing a new app for ownCloud and I <b>need to understand existing ownCloud File permission structure</b> for that.</div>
<div>I found that there are following CRUDS file permission constants defined in the code.</div>
<div><br></div><div><div><b style="background-color:rgb(243,243,243)"><font color="#999999">const PERMISSION_CREATE = 4;</font></b></div><div><b style="background-color:rgb(243,243,243)"><font color="#999999">const PERMISSION_READ = 1;</font></b></div>
<div><b style="background-color:rgb(243,243,243)"><font color="#999999">const PERMISSION_UPDATE = 2;</font></b></div><div><b style="background-color:rgb(243,243,243)"><font color="#999999">const PERMISSION_DELETE = 8;</font></b></div>
<div><b style="background-color:rgb(243,243,243)"><font color="#999999">const PERMISSION_SHARE = 16;</font></b></div><div><b style="background-color:rgb(243,243,243)"><font color="#999999"><br></font></b></div><div><b style="background-color:rgb(243,243,243)"><font color="#999999">const FORMAT_NONE = -1;</font></b></div>
<div><b style="background-color:rgb(243,243,243)"><font color="#999999">const FORMAT_STATUSES = -2;</font></b></div><div><b style="background-color:rgb(243,243,243)"><font color="#999999">const FORMAT_SOURCES = -3;</font></b></div>
<div><br></div><div>Suppose, I share a file with someone with following different privileges combinations. Then an entry will be added to '<b>oc_share</b>' table per each share. There is a column called '<b>permissions</b>' in '<b>oc_share</b>' table and I can't understand whether how does it get following values for permission column. I mean I can't understand the relationship.</div>
<div><br></div><div>*When I share a file <font color="#ff0000">with only share permission</font> (only 'share' check box is checked), then value of the permission column is <font color="#ff0000"><b>17</b></font>.</div>
<div>*When I share a file <font color="#ff0000">with only Delete permission</font> (only 'Delete' check box is checked), then value of the permission column is <font color="#ff0000"><b>9</b></font>.</div><div>
*When I share a file <font color="#ff0000">with only Update permission</font> (only 'Update' check box is checked), then value of the permission column is <b><font color="#ff0000">3</font></b>.<br></div><div>
*When I share a file <font color="#ff0000">with both share permission and Delete permission</font>, then value of the permission column is <font color="#ff0000"><b>25</b></font>.<br></div><div>*When I share a file <font color="#ff0000">with both share permission and Update permission</font>, then value of the permission column is <font color="#ff0000"><b>19</b></font>.</div>
<div>*When I share a file <font color="#ff0000">with both Delete permission and Update permission</font>, then value of the permission column is <font color="#ff0000"><b>11</b></font>.<br></div><div>*When I share a file <font color="#ff0000">with All permissions</font> (Update, Delete, Share), then value of the permission column is <font color="#ff0000"><b>27</b></font>.<br>
</div><div>*When I share a file <font color="#ff0000">with All permissions</font> (Update, Delete, Share), then value of the permission column is <font color="#ff0000"><b>27</b></font>.<br></div><div>*When I share a file <font color="#ff0000">with none of the permissions</font>, then value of the permission column is <font color="#ff0000"><b>1</b></font>.<br>
</div><div><br></div><div>Can somebody please explain me how these values are calculated.</div><div><br></div><div>Thanks in advanced. Please let me know, if this not clear enough.</div><span><font color="#888888">-- <br>
<div><br></div>
<div><div style="margin-top:3px;padding-top:2px;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Sampath Basnagoda,</b></font></div>
<div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Undergraduate,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Department of Computer Science and Engineering,</b></font></div>
<div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>University of Moratuwa,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Sri Lanka. </b></font></div>
</div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b><br></b></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">contacts - <a href="tel:%28%2B94%29716779281" value="+94716779281" title="Der externe Link wird in einem neuen Fenster geöffnet" target="_blank">(+94)716779281</a></font></i><font face="verdana, sans-serif"><i><br>
</i></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">Web Site - <a href="http://sampathbasnagoda.blogspot.com" title="Der externe Link wird in einem neuen Fenster geöffnet" target="_blank">sampathbasnagoda.blogspot.com</a></font></i></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div><div><div style="margin-top:3px;padding-top:2px;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Sampath Basnagoda,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Undergraduate,</b></font></div><div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Department of Computer Science and Engineering,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>University of Moratuwa,</b></font></div>
<div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Sri Lanka. </b></font></div></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b><br></b></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">contacts - <a href="tel:%28%2B94%29716779281" value="+94716779281" target="_blank">(+94)716779281</a></font></i><font face="verdana, sans-serif"><i><br>
</i></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">Web Site - <a href="http://sampathbasnagoda.blogspot.com" title="Der externe Link wird in einem neuen Fenster geöffnet" target="_blank">sampathbasnagoda.blogspot.com</a></font></i></div>
</div>
</div></div><pre>_______________________________________________<br>
Owncloud mailing list<br>
<a href="mailto:Owncloud@kde.org" target="_blank">Owncloud@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
</pre>
</blockquote>
</div>
<br>_______________________________________________<br>
Owncloud mailing list<br>
<a href="mailto:Owncloud@kde.org">Owncloud@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/owncloud" target="_blank">https://mail.kde.org/mailman/listinfo/owncloud</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><br></div><div><div style="margin-top:3px;padding-top:2px;font-family:Verdana,Arial,Helvetica,sans-serif"><br></div><div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Sampath Basnagoda,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>Undergraduate,</b></font></div><div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Department of Computer Science and Engineering,</b></font></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b>University of Moratuwa,</b></font></div><div style="margin-top:3px;padding-top:2px">
<font face="verdana, sans-serif"><b>Sri Lanka. </b></font></div></div><div style="margin-top:3px;padding-top:2px"><font face="verdana, sans-serif"><b><br></b></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">contacts - (+94)716779281</font></i><font face="verdana, sans-serif"><i><br>
</i></font></div><div style="margin-top:3px;padding-top:2px"><i><font face="verdana, sans-serif">Web Site - <a href="http://sampathbasnagoda.blogspot.com" target="_blank">sampathbasnagoda.blogspot.com</a></font></i></div>
</div>