check_posting_under

NAML documentation   Watch a video
   Usages of this macro
... in permissions.naml
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<macro name="check_posting_under" requires="user" dot_parameter="node_attr">
    <n.set_local_user
Macro
Parameters: user
.this_user
Binary
Namespace: UserNamespace
Parameters: do
 />
    <n.set_local_node
Macro
Parameters: node
.node_attr/>
    <n.block
Binary
Namespace: BasicNamespace
Parameters: do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_user
Macro
Parameters: do
.is_banned
Binary
Namespace: UserNamespace
>
            <then.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="banned"/>
        </n.if.local_user.is_banned>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.both
Binary
Namespace: BasicNamespace
Parameters: condition1, condition2
 condition1="[n.local_node
Macro
Parameters: do
.is_associated_with_mailing_list_archive
Binary
Namespace: NodeNamespace
/]" condition2="[n.not
Binary
Namespace: BasicNamespace
Parameters: condition
.local_user
Macro
Parameters: do
.is_authenticated
Binary
Namespace: UserNamespace
/]">
            <then.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="no_anonymous"/>
        </n.if.both>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_node
Macro
Parameters: do
.is_app
Binary
Namespace: NodeNamespace
>
            <then.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.local_user
Macro
Parameters: do
.has_permission
Binary
Namespace: UserNamespace
Parameters: node, permission_node, permission
 node="[n.local_node
Macro
Parameters: do
/]" permission_node="[n.local_node
Macro
Parameters: do
/]" permission="[n.create_topic_permission
Macro
/]" >
                <then.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_user
Macro
Parameters: do
.is_anonymous
Binary
Namespace: UserNamespace
>
                    <then.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="no_anonymous"/>
                    <else.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="no_create_topic_permission"/>
                </then.if.local_user.is_anonymous>
            </then.if.not.local_user.has_permission>
            <else.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.local_user
Macro
Parameters: do
.has_permission
Binary
Namespace: UserNamespace
Parameters: node, permission_node, permission
 node="[n.local_node
Macro
Parameters: do
/]" permission_node="[n.local_node
Macro
Parameters: do
.topic_or_app
Macro
Requires: node
Parameters: do
/]" permission="[n.reply_permission
Macro
/]" >
                <then.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_user
Macro
Parameters: do
.is_anonymous
Binary
Namespace: UserNamespace
>
                    <then.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="no_anonymous"/>
                    <else.throw_template_exception
Binary
Namespace: BasicNamespace
Parameters: name
 name="no_reply_permission"/>
                </then.if.local_user.is_anonymous>
            </else.if.not.local_user.has_permission>
        </n.if.local_node.is_app>
    </n.block.>
</macro>