mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Adding general Permissions
This commit is contained in:
parent
10c20f68c1
commit
cf434b1778
@ -17,7 +17,7 @@ class ChatLeaveAction extends AbstractAction {
|
||||
* @see \wcf\action\AbstractAction::$neededModules
|
||||
*/
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
public $room = null;
|
||||
public $userData = array();
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
class ChatForm extends AbstractForm {
|
||||
public $enableSmilies = 1;
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
public $message = '';
|
||||
public $room = null;
|
||||
public $userData = array();
|
||||
|
@ -13,7 +13,7 @@
|
||||
*/
|
||||
class ChatCopyrightPage extends AbstractPage {
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
|
||||
/**
|
||||
* @see \wcf\page\IPage::readParameters()
|
||||
|
@ -15,7 +15,7 @@
|
||||
class ChatMessagePage extends AbstractPage {
|
||||
public $messages = array();
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
public $room = null;
|
||||
public $roomID = 0;
|
||||
public $users = array();
|
||||
|
@ -16,7 +16,7 @@
|
||||
class ChatPage extends AbstractPage {
|
||||
public $chatVersion = '';
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
public $newestMessages = array();
|
||||
public $room = null;
|
||||
public $roomID = 0;
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
class ChatRefreshRoomListPage extends AbstractPage {
|
||||
public $neededModules = array('CHAT_ACTIVE');
|
||||
//public $neededPermissions = array('user.chat.canEnter');
|
||||
public $neededPermissions = array('user.chat.canEnter');
|
||||
public $room = null;
|
||||
public $roomID = 0;
|
||||
public $rooms = array();
|
||||
|
@ -88,7 +88,8 @@ protected function init() {
|
||||
*/
|
||||
public function getPermission(\wcf\data\chat\room\ChatRoom $room, $permission) {
|
||||
if (!isset($this->chatPermissions[$room->roomID][$permission])) {
|
||||
return isset(self::$defaults[$permission]) ? self::$defaults[$permission] : false;
|
||||
$permission = str_replace(array('user.', 'mod.'), array('user.chat.', 'mod.chat.'), $permission);
|
||||
return WCF::getUser()->getPermission($permission);
|
||||
}
|
||||
return (boolean) $this->chatPermissions[$room->roomID][$permission];
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<packagedescription><![CDATA[Chat for WoltLab Community Framework™]]></packagedescription>
|
||||
<standalone>0</standalone>
|
||||
<isunique>1</isunique>
|
||||
<version>3.0.0 Alpha 8</version>
|
||||
<version>3.0.0 Alpha 9</version>
|
||||
<date>2011-11-26</date>
|
||||
<plugin>com.woltlab.wcf.message</plugin> <!-- TODO: Correct me -->
|
||||
</packageinformation>
|
||||
|
@ -2,12 +2,42 @@
|
||||
<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/userGroupOption.xsd">
|
||||
<import>
|
||||
<categories>
|
||||
<category name="user.chat">
|
||||
<parent>user</parent>
|
||||
</category>
|
||||
<category name="mod.chat">
|
||||
<parent>mod</parent>
|
||||
</category>
|
||||
<category name="admin.content.chat">
|
||||
<parent>admin.content</parent>
|
||||
</category>
|
||||
</categories>
|
||||
|
||||
<options>
|
||||
<option name="user.chat.canEnter">
|
||||
<categoryname>user.chat</categoryname>
|
||||
<optiontype>boolean</optiontype>
|
||||
<defaultvalue>0</defaultvalue>
|
||||
<admindefaultvalue>0</admindefaultvalue>
|
||||
</option>
|
||||
<option name="user.chat.canWrite">
|
||||
<categoryname>user.chat</categoryname>
|
||||
<optiontype>boolean</optiontype>
|
||||
<defaultvalue>0</defaultvalue>
|
||||
<admindefaultvalue>0</admindefaultvalue>
|
||||
</option>
|
||||
<option name="mod.chat.canAlwaysEnter">
|
||||
<categoryname>mod.chat</categoryname>
|
||||
<optiontype>boolean</optiontype>
|
||||
<defaultvalue>0</defaultvalue>
|
||||
<admindefaultvalue>0</admindefaultvalue>
|
||||
</option>
|
||||
<option name="mod.chat.canAlwaysWrite">
|
||||
<categoryname>mod.chat</categoryname>
|
||||
<optiontype>boolean</optiontype>
|
||||
<defaultvalue>0</defaultvalue>
|
||||
<admindefaultvalue>0</admindefaultvalue>
|
||||
</option>
|
||||
<option name="admin.content.chat.canAddRoom">
|
||||
<categoryname>admin.content.chat</categoryname>
|
||||
<optiontype>boolean</optiontype>
|
||||
|
Loading…
Reference in New Issue
Block a user