403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/forum/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/forum/lib/permission.php
<?
namespace Bitrix\Forum;

use Bitrix\Main\Entity;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\ORM\Fields\Relations\Reference;
use Bitrix\Main\ORM\Query\Join;

/**
 * Class PermissionTable
 *
 * Fields:
 * <ul>
 * <li> ID int not null auto_increment,
 * <li> FORUM_ID int null,
 * <li> GROUP_ID int null,
 * <li> PERMISSION char(1)
 * </ul>
 *
 * @package Bitrix\Forum
 *
 * DO NOT WRITE ANYTHING BELOW THIS
 *
 * <<< ORMENTITYANNOTATION
 * @method static EO_Permission_Query query()
 * @method static EO_Permission_Result getByPrimary($primary, array $parameters = [])
 * @method static EO_Permission_Result getById($id)
 * @method static EO_Permission_Result getList(array $parameters = [])
 * @method static EO_Permission_Entity getEntity()
 * @method static \Bitrix\Forum\EO_Permission createObject($setDefaultValues = true)
 * @method static \Bitrix\Forum\EO_Permission_Collection createCollection()
 * @method static \Bitrix\Forum\EO_Permission wakeUpObject($row)
 * @method static \Bitrix\Forum\EO_Permission_Collection wakeUpCollection($rows)
 */
class PermissionTable extends Entity\DataManager
{
	/**
	 * Returns DB table name for entity
	 *
	 * @return string
	 */
	public static function getTableName()
	{
		return 'b_forum_perms';
	}

	/**
	 * Returns entity map definition.
	 *
	 * @return array
	 */
	public static function getMap()
	{
		return [
			new Entity\IntegerField('ID', ['primary' => true, 'autocomplete' => true]),
			new Entity\IntegerField('FORUM_ID'),
			new Entity\IntegerField('GROUP_ID'),
			new Entity\StringField('PERMISSION', ['size' => 1]),
			new Reference("GROUP", \Bitrix\Main\GroupTable::class, Join::on("this.ID", "ref.GROUP_ID"))
		];
	}
}


// A < E < I < M < Q < U < Y
class Permission {
	public const ACCESS_DENIED = "A";
	public const CAN_READ = "E";
	public const CAN_ADD_MESSAGE = "I";
	public const CAN_ADD_TOPIC = "M";
	public const CAN_MODERATE = "Q";
	public const CAN_EDIT = "U";
	public const FULL_ACCESS = "Y";

	/**
	 * Gets types list
	 * @return array
	 */
	public static function getList()
	{
		$res = (new \ReflectionClass(__CLASS__))->getConstants();
		$result = array();
		foreach ($res as $code => $id)
		{
			$result[$id] = $code;
		}
		return $result;
	}
	/**
	 * Gets types list
	 * @return array
	 */
	public static function getTitledList()
	{
		$res = (new \ReflectionClass(__CLASS__))->getConstants();
		$result = array();
		foreach ($res as $code => $id)
		{
			$result[$id] = Loc::getMessage("FORUM_PERMISSION_".$code);
		}
		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit