mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-13 11:28:10 -07:00
opers: Enforce oper class permissions
This commit is contained in:
@@ -247,6 +247,21 @@ func (client *Client) HasUsername() bool {
|
||||
return client.username != "" && client.username != "*"
|
||||
}
|
||||
|
||||
// HasCapabs returns true if client has the given (role) capabilities.
|
||||
func (client *Client) HasCapabs(capabs ...string) bool {
|
||||
if client.class == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, capab := range capabs {
|
||||
if !client.class.Capabilities[capab] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// <mode>
|
||||
func (c *Client) ModeString() (str string) {
|
||||
str = "+"
|
||||
|
||||
Reference in New Issue
Block a user