<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : help wanted with rights</title>
		<link>https://www.cotonti.com</link>
		<description>Laatste forum onderwerpen</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 17 Apr 2026 14:07:26 -0000</pubDate>

		<item>
			<title>ez</title>
			<description><![CDATA[Hi Gert,<br />
<br />
This was exactly what I was looking for... <br />
I knew it had to be ez <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" /> and that the info is already loaded..<br />
<br />
thnx,<br />
<br />
Leo<br />
<br />
<br />
By the way..  What is if($category == 'a') ????<br /><br /><b>Added 1 hour 28 minutes later:</b><br /><br />Hi Gert,<br />
<br />
I just realized this is for sienna... and sed_auth_getmask is not there.<br />
<br />
Can you tell me what to use for Genoa ??<br />
<br />
thnx]]></description>
			<pubDate>Vr, 31 Dec 2010 21:29:06 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27699]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[Loop through $usr['auth']['page'] to get the rights for each category.<br />
<br />
None = 0<br />
Read = 1<br />
Write = 2<br />
C1 = 4<br />
C2 = 8<br />
C3 = 16<br />
C4 = 32<br />
C5 = 64<br />
Admin = 128<br />
<br />
Value for auth is the sum of the allowed rights (so all rights = 255). C rights are custom rights, they become visible in adminpanel when you click 'more' at a rights configuration screen. C1 is used for pages with a file download (the members only download thing). In Siena C1 is also used for hidden users (if you have this right you can see hidden users).<br />
<br />
Use cot_auth_getmask() to convert number into a readable mask, such as RW12345A (255) or RW (3). Then use (strpos($mask, 'R') !== FALSE) to check for read access.<br />
<br />
<div class="highlight"><pre class="php">$allowedcats = array();
foreach($usr&#091;'auth'&#093;&#091;'page'&#093; as $category =&gt; $rights)
{
	if($category == 'a') continue;
	if(strpos(cot_auth_getmask($rights), 'R') !== FALSE)
	{
		$allowedcats&#091;&#093; = $category;
	}
}
$sqlcategories = implode(',', $allowedcats);</pre></div>]]></description>
			<pubDate>Vr, 31 Dec 2010 19:10:48 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27695]]></link>
		</item>
		<item>
			<title>MIHDev</title>
			<description><![CDATA[Ah ok, that makes sense, In this case you could use <pre class="code">Sed_Auth</pre> function.<br />
<br />
Have a look at List.Inc.Php for an example usage.<br />
Something like this from List.inc.php: <pre class="code">list($usr&#091;'auth_read'&#093;, $usr&#091;'auth_write'&#093;, $usr&#091;'isadmin'&#093;) = sed_auth('page', $c);
sed_block($usr&#091;'auth_read'&#093;);</pre>
<br />
From there you can pass in the <strong>$c</strong> var in a loop over the categories on the site.]]></description>
			<pubDate>Vr, 31 Dec 2010 18:11:33 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27694]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[hi, thnx for your response... but<br />
<br />
I do not want to make extra queries.. a lot off data is allready loaded when a user hits a site.<br />
So I can probably use the arrays in the memory?.<br />
<br />
Does Anyone have an answer ??]]></description>
			<pubDate>Vr, 31 Dec 2010 14:51:07 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27692]]></link>
		</item>
		<item>
			<title>MIHDev</title>
			<description><![CDATA[Hi Ez,<br />
<br />
Ok, well as far as I know from the tables this query should do it, depends on the levels set as well (possibly).<br />
<br />
Replace the Auth_GroupID = <strong>1</strong> with the GroupID you wish to view rights for.<br />
Replace the Auth_Rights = <strong>1</strong> with <strong>&gt;=1</strong> for all rights from Read to Admin.<br />
<br />
<div class="highlight"><pre class="sql">SELECT * FROM Sed_Auth WHERE Auth_GroupID = 1 AND Auth_Code = 'Page' AND Auth_Rights = 1</pre></div>
<br />
Use the Auth_Option to filter by page category.<br />
<div class="highlight"><pre class="sql">SELECT DISTINCT Auth_Option FROM Sed_Auth WHERE Auth_GroupID = 1 AND Auth_Code = 'Page'</pre></div>
<br />
To filter you could do the following:<br />
1. Get the GroupID of the current user.<br />
2. Use the GroupID of the current user in the SELECT statement above to filter down the Auth_Code and avoid the need for using another select on the Sed_Structure table.<br />
<br />
Hope this helps.<br />
<br />
Happy New Year<br />
<br />
MIHDev]]></description>
			<pubDate>Vr, 31 Dec 2010 06:30:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27691]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[How can I get all the categories (page_cat) were the current user have reading rights..<br />
<br />
I want to include a filter in an SQL statement to filter out only the pages were I have reading rights...<br />
<br />
something like :: WHERE page_cat IN (a,b,c,e)<br />
<br />
(note: i do not have reading rights for cat 'd')<br />
<br />
hope the answer comes soon <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" />]]></description>
			<pubDate>Vr, 31 Dec 2010 04:07:23 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6097&d=0#post27689]]></link>
		</item>
	</channel>
</rss>