<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 style>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 style><br></div><div 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>.</div>
<div style>*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 style>
*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 style>
*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 style>*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 style>Can somebody please explain me how these values are calculated.</div><div style><br></div><div style>Thanks in advanced. Please let me know, if this not clear enough.</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></div>