Check Threadpermissions

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
Hi, i'm working on an Twitter Add-on.

This Add-on should send all new Threads which guests can see to Twitter.

Sending to Twitter works perfect, my only problem is the permissions check.
I don't like to send "private Threads" ( for example from admin area, customer area, private/mod category)

How can i check the read permissions if i have the thread id?
 
Ok, i think i've found something.Have to try if
PHP:
$ftpHelper = $this->getHelper('ForumThreadPost');
        $threadFetchOptions = array('readUserId' => $visitor['user_id'], 'watchUserId' => $visitor['user_id']);
        $forumFetchOptions = array('readUserId' => $visitor['user_id']);
        list($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId, $threadFetchOptions, $forumFetchOptions);
works
 
Top Bottom