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

(has_access): New function. This is a simple wrapper around

	access_perm that simplifies the code.
(filter_conf_no): Use has_access() instead of access_perm() to
	simplify code.
(sub_member): Ditto.
(add_member_common): Ditto.
parent d106f848
/*
* $Id: membership.c,v 0.89 2003/08/05 09:51:00 ceder Exp $
* $Id: membership.c,v 0.90 2003/08/12 13:58:51 ceder Exp $
* Copyright (C) 1991-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -1069,11 +1069,20 @@ access_perm(Conf_no victim,
}
Bool
has_access(Conf_no victim,
const Connection *viewer_conn,
enum access wanted_access)
{
return access_perm(victim, viewer_conn, wanted_access) >= wanted_access;
}
Conf_no
filter_conf_no(Conf_no victim,
const Connection *viewer_conn)
{
if (access_perm(victim, viewer_conn, read_protected) >= read_protected)
if (has_access(victim, viewer_conn, read_protected))
return victim;
else
return 0;
......@@ -1156,7 +1165,7 @@ sub_member( Conf_no conf_no,
/* If the conference is secret, we have to return an error
code for the conference instead of for the person. */
if (access_perm(conf_no, active_connection, read_protected) <= none)
if (!has_access(conf_no, active_connection, read_protected))
{
kom_errno = KOM_UNDEF_CONF;
err_stat = conf_no;
......@@ -1240,7 +1249,7 @@ add_member_common(Conf_no conf_no,
}
/* Check access to the conference. We need limited access or more */
if (access_perm(conf_no, active_connection, limited) < limited
if (!has_access(conf_no, active_connection, limited)
&& !ENA(wheel, 8) ) /* OK -- Guarded */
{
err_stat = conf_no;
......
Supports Markdown
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