summaryrefslogtreecommitdiff
path: root/src/modules/opflags.h
blob: 4d927b47c1cabe96f31f53197640c820b7e6540b (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*       +------------------------------------+
 *       | Inspire Internet Relay Chat Daemon |
 *       +------------------------------------+
 *
 *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
 * See: http://wiki.inspircd.org/Credits
 *
 * This program is free but copyrighted software; see
 *	    the file COPYING for details.
 *
 * ---------------------------------------------------
 */

#ifndef __OPFLAGS_H__
#define __OPFLAGS_H__

class OpFlagProvider : public DataProvider
{
 public:
	OpFlagProvider(Module* mod, const std::string& Name) : DataProvider(mod, Name) {}

	/** Get the list of flags for a user */
	virtual std::string GetFlags(Membership* memb) = 0;

	/** Set the flag list for a user */
	virtual void SetFlags(Membership* memb, const std::string& flags, bool sendGlobal) = 0;
	virtual std::string SetFlags(Membership* memb, const std::set<std::string>& flags, bool sendGlobal) = 0;

	/**
	 * Check if the user has permission based on a mode/flag list
	 * @param memb The user/channel to check
	 * @param needed A list of flags to check for
	 * @return true if the user has at least one of the listed flags
	 */
	virtual bool PermissionCheck(Membership*, const std::string& needed) = 0;
};

#endif