Function __global->cns_may_access_topic
Definitions
sources/cns_topics.php
- Find whether a member may access a topic.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $topic_id | AUTO_LINK | No | No | required parameter | N/A | N/A | The topic |
| $member_id | ?MEMBER | No | No | Null | N/A | N/A | The member (null: current member) |
| $topic_info | ?array | No | No | Null | N/A | N/A | The topic row (null: look up from $topic_id) |
| $check_validation | boolean | No | No | True | N/A | N/A | Whether to check validation |
Returns
- The answer
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find whether a member may access a topic.
*
* @param AUTO_LINK $topic_id The topic
* @param ?MEMBER $member_id The member (null: current member)
* @param ?array $topic_info The topic row (null: look up from $topic_id)
* @param boolean $check_validation Whether to check validation
* @return boolean The answer
*/
function cns_may_access_topic(int $topic_id, ?int $member_id = null, ?array $topic_info = null, bool $check_validation = true) : bool
* Find whether a member may access a topic.
*
* @param AUTO_LINK $topic_id The topic
* @param ?MEMBER $member_id The member (null: current member)
* @param ?array $topic_info The topic row (null: look up from $topic_id)
* @param boolean $check_validation Whether to check validation
* @return boolean The answer
*/
function cns_may_access_topic(int $topic_id, ?int $member_id = null, ?array $topic_info = null, bool $check_validation = true) : bool
