From 2977a23070faaddc9972b2ce6f22452be471b12e Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 30 Apr 2004 14:40:03 +0000 Subject: Added support for HasPermission method git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@755 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/users.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/users.h b/include/users.h index c1a6aa3af..741e94dfb 100644 --- a/include/users.h +++ b/include/users.h @@ -136,6 +136,13 @@ class userrec : public connection * will be disconnected */ unsigned long timeout; + + /** The oper type they logged in as, if they are an oper. + * This is used to check permissions in operclasses, so that + * we can say 'yay' or 'nay' to any commands they issue. + * The value of this is the value of a valid 'type name=' tag. + */ + char oper[NICKMAX]; userrec(); @@ -168,6 +175,12 @@ class userrec : public connection */ virtual void RemoveInvite(char* channel); + /** Returns true or false for if a user can execute a privilaged oper command. + * This is done by looking up their oper type from userrec::oper, then referencing + * this to their oper classes and checking the commands they can execute. + */ + virtual bool HasPermission(char* command); + }; -- cgit v1.2.3