ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/privs.h
Revision: 1.3
Committed: Tue Aug 28 17:08:07 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +13 -12 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# Content
1 /*
2 * Copyright © 2005 Jilles Tjoelker, et al.
3 * Rights to this code are as documented in doc/pod/license.pod.
4 *
5 * Fine grained services operator privileges
6 *
7 * $Id: privs.h,v 1.2 2007-07-21 01:29:07 pippijn Exp $
8 */
9
10 #ifndef PRIVS_H
11 #define PRIVS_H
12
13 #define PRIV_NONE NULL
14
15 /* nickserv/userserv */
16 #define PRIV_USER_AUSPEX "user:auspex"
17 #define PRIV_USER_ADMIN "user:admin"
18 #define PRIV_USER_SENDPASS "user:sendpass"
19 #define PRIV_USER_VHOST "user:vhost"
20 #define PRIV_USER_FREGISTER "user:fregister"
21 /* chanserv */
22 #define PRIV_CHAN_AUSPEX "chan:auspex"
23 #define PRIV_CHAN_ADMIN "chan:admin"
24 #define PRIV_CHAN_CMODES "chan:cmodes"
25 #define PRIV_JOIN_STAFFONLY "chan:joinstaffonly"
26 /* nickserv/userserv+chanserv */
27 #define PRIV_MARK "user:mark"
28 #define PRIV_HOLD "user:hold"
29 #define PRIV_REG_NOLIMIT "user:regnolimit"
30 /* generic */
31 #define PRIV_SERVER_AUSPEX "general:auspex"
32 #define PRIV_VIEWPRIVS "general:viewprivs"
33 #define PRIV_FLOOD "general:flood"
34 #define PRIV_METADATA "general:metadata"
35 #define PRIV_ADMIN "general:admin"
36 /* operserv */
37 #define PRIV_OMODE "operserv:omode"
38 #define PRIV_AKILL "operserv:akill"
39 #define PRIV_MASS_AKILL "operserv:massakill"
40 #define PRIV_AKILL_ANYMASK "operserv:akill-anymask"
41 #define PRIV_JUPE "operserv:jupe"
42 #define PRIV_NOOP "operserv:noop"
43 #define PRIV_GLOBAL "operserv:global"
44 #define PRIV_GRANT "operserv:grant"
45
46 /* obsolete access levels */
47 #define AC_NONE NULL
48 /* please do not use the following anymore */
49 #define AC_IRCOP "special:ircop"
50 #define AC_SRA "general:admin"
51
52 struct operclass_t : zero_initialised
53 {
54 char *name;
55 char *privs; /* priv1 priv2 priv3... */
56 int flags;
57 };
58
59 #define OPERCLASS_NEEDOPER 0x1 /* only give privs to IRCops */
60
61 /* soper list struct */
62 struct soper_t : zero_initialised
63 {
64 myuser_t *myuser;
65 char *name;
66 operclass_t *operclass;
67 char *classname;
68 int flags;
69 };
70
71 #define SOPER_CONF 0x1 /* oper is listed in atheme.conf */
72
73 /* privs.c */
74 E list_t operclasslist;
75 E list_t soperlist;
76
77 E void init_privs (void);
78
79 E operclass_t *operclass_add (char *name, char const *privs);
80 E void operclass_delete (operclass_t *operclass);
81 E operclass_t *operclass_find (char const * const name);
82
83 E soper_t *soper_add (char *name, char *classname, int flags);
84 E void soper_delete (soper_t *soper);
85 E soper_t *soper_find (myuser_t *myuser);
86 E soper_t *soper_find_named (char *name);
87
88 E bool is_soper (myuser_t *myuser);
89 E bool is_conf_soper (myuser_t *myuser);
90
91 /* has_any_privs(): used to determine whether we should give detailed
92 * messages about disallowed things
93 * warning: do not use this for any kind of real privilege! */
94 E bool has_any_privs (sourceinfo_t *si);
95 E bool has_any_privs_user (user_t *u);
96 /* has_priv(): for sources of commands */
97 E bool has_priv (sourceinfo_t *si, char const * const priv);
98 /* has_priv_user(): for online users */
99 E bool has_priv_user (user_t *u, char const * const priv);
100 /* has_priv_myuser(): channel succession etc */
101 E bool has_priv_myuser (myuser_t *mu, char const * const priv);
102 /* has_priv_operclass(): /os specs etc */
103 E bool has_priv_operclass (operclass_t *oc, char const * const priv);
104 /* has_all_operclass(): checks if source has all privs in operclass */
105 E bool has_all_operclass (sourceinfo_t *si, operclass_t *oc);
106
107 #endif /* PRIVS_H */