public/IAdminSystem.h
changeset 434 db80fdcb09ce
parent 433 d699e31199ad
child 438 e6e11c82d87e
     1.1 --- a/public/IAdminSystem.h	Mon Feb 05 09:14:40 2007 +0000
     1.2 +++ b/public/IAdminSystem.h	Mon Feb 05 10:34:58 2007 +0000
     1.3 @@ -416,7 +416,7 @@
     1.4  		virtual bool GetAdminFlag(AdminId id, AdminFlag flag, AccessMode mode) =0;
     1.5  
     1.6  		/**
     1.7 -		 * @brief Returns a bitarray of flags enabled on an admin.
     1.8 +		 * @brief Returns the bitstring of access flags on an admin.
     1.9  		 *
    1.10  		 * @param id		AdminId index of the admin.
    1.11  		 * @param mode		Access mode to use.
    1.12 @@ -524,6 +524,35 @@
    1.13  		 * @return			Number of flags written.
    1.14  		 */
    1.15  		virtual unsigned int FlagBitsToArray(FlagBits bits, AdminFlag array[], unsigned int maxSize) =0;
    1.16 +
    1.17 +		/**
    1.18 +		 * @brief Checks whether a user has access to a given set of flag bits.
    1.19 +		 * Note: This is a wrapper around GetAdminFlags().
    1.20 +		 *
    1.21 +		 * @param id		AdminId index of admin.
    1.22 +		 * @param flags		Bitstring containing the permissions to check.
    1.23 +		 * @return			True if user has permission, false otherwise.
    1.24 +		 */
    1.25 +		virtual bool CheckAdminFlags(AdminId id, FlagBits bits) =0;
    1.26 +
    1.27 +		/**
    1.28 +		 * @brief Checks whether an AdminId can target another AdminId.
    1.29 +		 * 
    1.30 +		 * Zeroth, if the targeting AdminId is INVALID_ADMIN_ID, targeting fails.
    1.31 +		 * First, if the targetted AdminId is INVALID_ADMIN_ID, targeting succeeds.
    1.32 +		 * Second, if the targeting admin is root, targeting suceeds.
    1.33 +		 * Third, if the targetted admin has global immunity, targeting fails.
    1.34 +		 * Fourth, if the targetted admin has default immunity,
    1.35 +		 *  and the admin belongs to no groups, targeting fails.
    1.36 +		 * Fifth, if the targetted admin has specific immunity from the
    1.37 +		 *  targeting admin via group immunities, targeting fails.
    1.38 +		 * Sixth, targeting succeeds if it passes these tests.
    1.39 +		 *
    1.40 +		 * @param id		AdminId index of admin doing the targeting.  Can be INVALID_ADMIN_ID.
    1.41 +		 * @param target	AdminId index of the target admin.  Can be INVALID_ADMIN_ID.
    1.42 +		 * @return			True if this admin has permission to target the other admin.
    1.43 +		 */
    1.44 +		virtual bool CanAdminTarget(AdminId id, AdminId target) =0;
    1.45  	};
    1.46  }
    1.47