mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt grant
This commit is contained in:
parent
a15365fbb0
commit
c7d8d33e2c
30
core/chat/grant.go
Normal file
30
core/chat/grant.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package chat
|
||||||
|
|
||||||
|
import (
|
||||||
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
)
|
||||||
|
|
||||||
|
const GRANT = "grant"
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||||
|
GRANT: {Name: "grant space id auto insert", Help: "授权", Action: ice.MergeAction(map[string]*ice.Action{
|
||||||
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
switch arg[0] {
|
||||||
|
case web.SPACE:
|
||||||
|
m.Cmdy(web.SPACE).RenameAppend(mdb.NAME, web.SPACE).Cut("space,type")
|
||||||
|
case GRANT:
|
||||||
|
m.Cmdy(web.SPACE, m.Option(web.SPACE), web.SPACE).RenameAppend(mdb.NAME, GRANT).Cut("grant,type")
|
||||||
|
case aaa.USERROLE:
|
||||||
|
m.Push(arg[0], m.Option(ice.MSG_USERROLE))
|
||||||
|
case aaa.USERNAME:
|
||||||
|
m.Push(arg[0], m.Option(ice.MSG_USERNAME))
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
mdb.INSERT: {Name: "insert space grant userrole username", Help: "添加"},
|
||||||
|
}, mdb.ZoneAction(mdb.SHORT, web.SPACE, mdb.FIELD, "time,grant,userrole,username"))},
|
||||||
|
}})
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user