• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Check Threadpermissions

R

ragtek

Guest
#1
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?
 
R

ragtek

Guest
#2
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