Commit 062f68af authored by Per Cederqvist's avatar Per Cederqvist

(access_perm): New parameter: wanted_access. Never return anything

	higher than it.  All callers updated.
(fast_access_perm): Removed.  All callers changed to use access_perm instead.
parent 86a30481
/*
* $Id: manipulate.h,v 0.24 1999/06/05 12:19:04 byers Exp $
* $Id: manipulate.h,v 0.25 1999/07/01 21:24:08 ceder Exp $
* Copyright (C) 1991-1994, 1996-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: manipulate.h,v 0.24 1999/06/05 12:19:04 byers Exp $
* $Id: manipulate.h,v 0.25 1999/07/01 21:24:08 ceder Exp $
*
* manipulate.h
*
......@@ -202,21 +202,9 @@
}
/*
* A value of the following type are returned from access_perm() and
* fast_access_perm(). They are used to see how much viewer is allowed to
* read/modify the data of a given conference.
*
* access_perm() alway returns the "highest" from this list.
* fast_access_perm() avoids reading the conference struct. It will only
* return "unlimited" if the conference is secret and ACTPERS
* is not a member of the conference. fast_access_perm() is used
* in lookup_name() which sometimes have to check the access
* permissions of _all_ conferences. If access_perm() was used
* _all_ conference statuses would have to be read in into the
* cache in a single atomic call, and that would mean that the
* cache would overflow if there are many conferences.
* Now only the conference statuses for secret conferences of
* which ACTPERS is not a member have to be read in.
* A value of the following type are returned from access_perm(),
* which is used to see how much viewer is allowed to read/modify the
* data of a given conference.
*/
typedef enum {
......@@ -228,6 +216,17 @@ typedef enum {
unlimited /* ACTPERS is supervisor of the conference. */
} Access;
/* Return the highest access level that viewer_conn has to victim, but
don't bother checking for higher level of access than
wanted_access. Specify as low wanted_access as possible when
calling this function, since that might speed upp the processing
considerably. */
extern Access
access_perm(Conf_no victim,
Conference *victim_c,
Connection *viewer_conn,
Access wanted_access);
/*
......@@ -343,44 +342,6 @@ do_add_member(Conf_no conf_no, /* Conference to add a new member to. */
Bool fake_priority
);
/*
* Return TRUE if VIEWER_CONN has enough privileges to access VICTIM's data.
* VICTIM is a person or a conference.
* Meaning of return values:
* unlimited: VIEWER_CONN is supervisor of VICTIM, or ACTPERS is admin,
* or ACTPERS is VICTIM
* none: VICTIM is secret, and VIEWER_CONN is not a member
* member: VIEWER_CONN is a member in VICTIM, but doesn't have unlimited
* access.
* limited: otherwise.
* error: see kom_errno
*/
extern Access
access_perm(Conf_no victim,
Conference * victim_c, /* May be NULL */
Connection * viewer_conn);
/*
* Fast version of access_perm. This function does not check if ATCPERS is a
* supervisor of the conference. This function should be used i calls where
* a lot of conferences are checked to avoid readin in conferences from the
* cache.
*
* BUG: If a person is supervisor of a secret conf he is not member in the
* result will be 'none'.
*
* unlimited: viewer_conn is admin, or viewer_conn is VICTIM
* none: VICTIM is secret, and ACTPERS is not a member
* member: viewer_conn is a member in VICTIM, but doesn't have unlimited
* access.
* limited: otherwise.
* error: see kom_errno
*/
Access
fast_access_perm(Conf_no victim,
Connection *viewer_conn);
/*
* Return TRUE if NAME is a legal name. Set kom_errno otherwize.
......
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