Commit f140144b authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(filter_secret_info): Use has_access() instead of access_perm() to

	simplify code.
(add_recipient): Ditto.
(sub_recipient): Ditto.
parent 82116a38
/*
* $Id: text.c,v 0.107 2003/07/27 15:03:12 ceder Exp $
* $Id: text.c,v 0.108 2003/08/12 13:59:08 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -1240,8 +1240,7 @@ filter_secret_info(Text_stat *result,
{
case recpt:
case cc_recpt:
if ((access_perm(orig->datum.recipient, viewer_conn,
read_protected) <= none)
if (!has_access(orig->datum.recipient, viewer_conn, read_protected)
&& !ENA_C(viewer_conn, admin, 4))
{
skip_recp(&orig, original);
......@@ -1264,17 +1263,15 @@ filter_secret_info(Text_stat *result,
*/
if (viewer_p != NULL
&& (access_perm(orig->datum.recipient, viewer_conn,
limited) >= limited
&& (has_access(orig->datum.recipient, viewer_conn, limited)
|| locate_membership(orig->datum.recipient, viewer_p)
|| ENA_C(viewer_conn, admin, 4)
|| recp_sent_by(
orig, original->misc_items + original->no_of_misc,
viewer, viewer_p)
|| (is_supervisor(original->author, viewer, viewer_p)
&& (access_perm(orig->datum.recipient,
viewer_conn, read_protected)
>= read_protected))))
&& (has_access(orig->datum.recipient,
viewer_conn, read_protected)))))
{
*copy++ = *orig++;
++result->no_of_misc;
......@@ -2713,7 +2710,7 @@ add_recipient(Text_no text_no,
/* Get the conference */
GET_C_STAT(conf_c, conf_no, FAILURE);
if (access_perm(conf_no, active_connection, read_protected) <= none)
if (!has_access(conf_no, active_connection, read_protected))
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......@@ -2883,7 +2880,7 @@ sub_recipient(Text_no text_no,
return FAILURE;
}
if (access_perm(conf_no, active_connection, read_protected) <= none)
if (!has_access(conf_no, active_connection, read_protected))
{
err_stat = conf_no;
kom_errno = KOM_UNDEF_CONF;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment