<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta name="Generator" content="Zarafa WebApp v7.1.4-41394">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>AW: [Owncloud] [OwnCloud] ownCloud file permission structure</title>
</head>
<body>
<p style="color: rgb(0, 0, 0); ">Hi Sampath,</p><p style="color: rgb(0, 0, 0); ">that's simple. You know the possible permissions and the corresponding numeric values. The numeric values are "powers of two".</p><p style="color: rgb(0, 0, 0); ">READ = 2^0</p><p style="color: rgb(0, 0, 0); ">UPDATE = 2^1</p><p style="color: rgb(0, 0, 0); ">CREATE = 2^2</p><p style="color: rgb(0, 0, 0); ">...</p><p style="color: rgb(0, 0, 0); ">A permission-set is the sum of these values.</p><p style="color: rgb(0, 0, 0); ">Examples:</p><p style="color: rgb(0, 0, 0); ">*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><p style="color: rgb(0, 0, 0); ">--> 8 (DELETE) + 2 (UPDATE) + 1 (READ) = 11</p><p style="color: rgb(0, 0, 0); ">*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><p><font>--> 16 (SHARE) + 1 (READ) = 17</font></p><p>Best</p><p>Jan</p><blockquote style="color: rgb(0, 0, 0); border-left-width: 2px; border-left-style: solid; border-left-color: rgb(50, 95, 186); padding-left: 5px; margin-left: 5px; margin-right: 0px; ">-----Ursprüngliche Nachricht-----<br><strong>Von:</strong> Sampath Basnagoda <sampathbasnagoda@gmail.com><br><strong>Gesendet:</strong> Die 4 Juni 2013 10:52<br><strong>An:</strong> owncloud@kde.org<br><strong>Betreff:</strong> Re: [Owncloud] [OwnCloud] ownCloud file permission structure<br><br><base target="_blank">
<!-- begin sanitized html -->
<div dir="ltr">Can Somebody please help me with this? <div style="yes">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" onclick="parent.webclient.openWindow(this, 'createmail', 'index.php?load=dialog&task=createmail_standard&to=sampathbasnagoda@gmail.com'); return false;" target="_blank" title="Der externe Link wird in einem neuen Fenster geöffnet">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 class="HOEnZb"><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" target="_blank" title="Der externe Link wird in einem neuen Fenster geöffnet">(+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" target="_blank" title="Der externe Link wird in einem neuen Fenster geöffnet">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 - (+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" title="Der externe Link wird in einem neuen Fenster geöffnet">sampathbasnagoda.blogspot.com</a></font></i></div>

</div>
<pre>_______________________________________________<br>
Owncloud mailing list<br>
Owncloud@kde.org<br>
https://mail.kde.org/mailman/listinfo/owncloud<br>
</pre>
<!-- end sanitized html -->
</blockquote>
</body>
</html>