ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/privs.h
(Generate patch)

Comparing ermyth/include/privs.h (file contents):
Revision 1.2 by pippijn, Sat Jul 21 01:29:07 2007 UTC vs.
Revision 1.3 by pippijn, Tue Aug 28 17:08:07 2007 UTC

1/* 1/*
2 * Copyright © 2005 Jilles Tjoelker, et al. 2 * Copyright © 2005 Jilles Tjoelker, et al.
3 * Rights to this code are as documented in doc/pod/license.pod. 3 * Rights to this code are as documented in doc/pod/license.pod.
4 * 4 *
5 * Fine grained services operator privileges 5 * Fine grained services operator privileges
6 * 6 *
7 * $Id: privs.h,v 1.2 2007/07/21 01:29:07 pippijn Exp $ 7 * $Id: privs.h,v 1.3 2007/08/28 17:08:07 pippijn Exp $
8 */ 8 */
9 9
10#ifndef PRIVS_H 10#ifndef PRIVS_H
11#define PRIVS_H 11#define PRIVS_H
12 12
35#define PRIV_ADMIN "general:admin" 35#define PRIV_ADMIN "general:admin"
36/* operserv */ 36/* operserv */
37#define PRIV_OMODE "operserv:omode" 37#define PRIV_OMODE "operserv:omode"
38#define PRIV_AKILL "operserv:akill" 38#define PRIV_AKILL "operserv:akill"
39#define PRIV_MASS_AKILL "operserv:massakill" 39#define PRIV_MASS_AKILL "operserv:massakill"
40#define PRIV_AKILL_ANYMASK "operserv:akill-anymask"
40#define PRIV_JUPE "operserv:jupe" 41#define PRIV_JUPE "operserv:jupe"
41#define PRIV_NOOP "operserv:noop" 42#define PRIV_NOOP "operserv:noop"
42#define PRIV_GLOBAL "operserv:global" 43#define PRIV_GLOBAL "operserv:global"
43#define PRIV_GRANT "operserv:grant" 44#define PRIV_GRANT "operserv:grant"
44 45
46#define AC_NONE NULL 47#define AC_NONE NULL
47/* please do not use the following anymore */ 48/* please do not use the following anymore */
48#define AC_IRCOP "special:ircop" 49#define AC_IRCOP "special:ircop"
49#define AC_SRA "general:admin" 50#define AC_SRA "general:admin"
50 51
51struct operclass_t 52struct operclass_t : zero_initialised
52{ 53{
53 char *name; 54 char *name;
54 char *privs; /* priv1 priv2 priv3... */ 55 char *privs; /* priv1 priv2 priv3... */
55 int flags; 56 int flags;
56}; 57};
57 58
58#define OPERCLASS_NEEDOPER 0x1 /* only give privs to IRCops */ 59#define OPERCLASS_NEEDOPER 0x1 /* only give privs to IRCops */
59 60
60/* soper list struct */ 61/* soper list struct */
61struct soper_t 62struct soper_t : zero_initialised
62{ 63{
63 myuser_t *myuser; 64 myuser_t *myuser;
64 char *name; 65 char *name;
65 operclass_t *operclass; 66 operclass_t *operclass;
66 char *classname; 67 char *classname;
75 76
76E void init_privs (void); 77E void init_privs (void);
77 78
78E operclass_t *operclass_add (char *name, char const *privs); 79E operclass_t *operclass_add (char *name, char const *privs);
79E void operclass_delete (operclass_t *operclass); 80E void operclass_delete (operclass_t *operclass);
80E operclass_t *operclass_find (char *name); 81E operclass_t *operclass_find (char const * const name);
81 82
82E soper_t *soper_add (char *name, char *classname, int flags); 83E soper_t *soper_add (char *name, char *classname, int flags);
83E void soper_delete (soper_t *soper); 84E void soper_delete (soper_t *soper);
84E soper_t *soper_find (myuser_t *myuser); 85E soper_t *soper_find (myuser_t *myuser);
85E soper_t *soper_find_named (char *name); 86E soper_t *soper_find_named (char *name);
88E bool is_conf_soper (myuser_t *myuser); 89E bool is_conf_soper (myuser_t *myuser);
89 90
90/* has_any_privs(): used to determine whether we should give detailed 91/* has_any_privs(): used to determine whether we should give detailed
91 * messages about disallowed things 92 * messages about disallowed things
92 * warning: do not use this for any kind of real privilege! */ 93 * warning: do not use this for any kind of real privilege! */
93E bool has_any_privs (sourceinfo_t *); 94E bool has_any_privs (sourceinfo_t *si);
94E bool has_any_privs_user (user_t *); 95E bool has_any_privs_user (user_t *u);
95/* has_priv(): for sources of commands */ 96/* has_priv(): for sources of commands */
96E bool has_priv (sourceinfo_t *, const char *); 97E bool has_priv (sourceinfo_t *si, char const * const priv);
97/* has_priv_user(): for online users */ 98/* has_priv_user(): for online users */
98E bool has_priv_user (user_t *, const char *); 99E bool has_priv_user (user_t *u, char const * const priv);
99/* has_priv_myuser(): channel succession etc */ 100/* has_priv_myuser(): channel succession etc */
100E bool has_priv_myuser (myuser_t *, const char *); 101E bool has_priv_myuser (myuser_t *mu, char const * const priv);
101/* has_priv_operclass(): /os specs etc */ 102/* has_priv_operclass(): /os specs etc */
102E bool has_priv_operclass (operclass_t *, const char *); 103E bool has_priv_operclass (operclass_t *oc, char const * const priv);
103/* has_all_operclass(): checks if source has all privs in operclass */ 104/* has_all_operclass(): checks if source has all privs in operclass */
104E bool has_all_operclass (sourceinfo_t *, operclass_t *); 105E bool has_all_operclass (sourceinfo_t *si, operclass_t *oc);
105 106
106#endif /* PRIVS_H */ 107#endif /* PRIVS_H */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines