All modules converted to use privsets by porting the macro over.

New macro, HasPrivilege() does most of the work here, the old IsOper*() macros
are deprecated, and will likely be removed later.
This commit is contained in:
William Pitcock 2008-08-17 08:36:17 -05:00
parent 34cb09ceea
commit 73a3435109
1 changed files with 19 additions and 18 deletions

View File

@ -167,24 +167,25 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperConfEncrypted(x) ((x)->flags & OPER_ENCRYPTED) #define IsOperConfEncrypted(x) ((x)->flags & OPER_ENCRYPTED)
#define IsOperGlobalKill(x) ((x)->flags2 & OPER_GLOBKILL) #define HasPrivilege(x, y) (privilegeset_in_set((x)->localClient->privset, (y)))
#define IsOperLocalKill(x) ((x)->flags2 & OPER_LOCKILL)
#define IsOperRemote(x) ((x)->flags2 & OPER_REMOTE) #define IsOperGlobalKill(x) (HasPrivilege((x), "oper:global_kill"))
#define IsOperUnkline(x) ((x)->flags2 & OPER_UNKLINE) #define IsOperLocalKill(x) (HasPrivilege((x), "oper:local_kill"))
#define IsOperN(x) ((x)->flags2 & OPER_NICKS) #define IsOperRemote(x) (HasPrivilege((x), "oper:routing"))
#define IsOperK(x) ((x)->flags2 & OPER_KLINE) #define IsOperUnkline(x) (HasPrivilege((x), "oper:unkline"))
#define IsOperXline(x) ((x)->flags2 & OPER_XLINE) #define IsOperN(x) (HasPrivilege((x), "snomask:nick_changes"))
#define IsOperResv(x) ((x)->flags2 & OPER_RESV) #define IsOperK(x) (HasPrivilege((x), "oper:kline"))
#define IsOperDie(x) ((x)->flags2 & OPER_DIE) #define IsOperXline(x) (HasPrivilege((x), "oper:xline"))
#define IsOperRehash(x) ((x)->flags2 & OPER_REHASH) #define IsOperResv(x) (HasPrivilege((x), "oper:resv"))
#define IsOperHiddenAdmin(x) ((x)->flags2 & OPER_HADMIN) #define IsOperDie(x) (HasPrivilege((x), "oper:die"))
#define IsOperAdmin(x) (((x)->flags2 & OPER_ADMIN) || \ #define IsOperRehash(x) (HasPrivilege((x), "oper:rehash"))
((x)->flags2 & OPER_HADMIN)) #define IsOperHiddenAdmin(x) (HasPrivilege((x), "oper:hidden_admin"))
#define IsOperOperwall(x) ((x)->flags2 & OPER_OPERWALL) #define IsOperAdmin(x) (HasPrivilege((x), "oper:admin") || HasPrivilege((x), "oper:hidden_admin"))
#define IsOperSpy(x) ((x)->flags2 & OPER_SPY) #define IsOperOperwall(x) (HasPrivilege((x), "oper:operwall"))
#define IsOperInvis(x) ((x)->flags2 & OPER_INVIS) #define IsOperSpy(x) (HasPrivilege((x), "oper:spy"))
#define IsOperRemoteBan(x) ((x)->flags2 & OPER_REMOTEBAN) #define IsOperInvis(x) (HasPrivilege((x), "oper:hidden"))
#define IsOperMassNotice(x) ((x)->flags2 & OPER_MASSNOTICE) #define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban"))
#define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice"))
extern struct oper_conf *make_oper_conf(void); extern struct oper_conf *make_oper_conf(void);
extern void free_oper_conf(struct oper_conf *); extern void free_oper_conf(struct oper_conf *);