From e5e1343ace36d7260fde4096df2afc93258fcf18 Mon Sep 17 00:00:00 2001 From: Logan Fick <587ml873m0poe2s1pjsmx3vi37tn5p@gmail.com> Date: Thu, 13 Aug 2015 21:20:02 -0400 Subject: [PATCH 1/3] Make help dialogue only show commands you have perms to Now if you get to the page explaining all the commands and what they do, it will only display each command you have the permissions too. --- saylol.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/saylol.py b/saylol.py index f1854df..0bd47fd 100644 --- a/saylol.py +++ b/saylol.py @@ -95,9 +95,14 @@ def on_lol_command(sender, command, label, args): msg(sender, "&cInvalid number '&e%s&c'" % args[1]) else: - msg(sender, "&a/lol &eSay random message") - msg(sender, "&a/lol list &eList all messages") - msg(sender, "&a/lol id &eSay specific message") - msg(sender, "&a/lol add &eAdd message") - msg(sender, "&a/lol del &eDelete message") + if sender.hasPermission("utils.lol"): + msg(sender, "&a/lol &eSay random message") + msg(sender, "&a/lol list &eList all messages") + if sender.hasPermission("utils.lol.id"): + msg(sender, "&a/lol id &eSay specific message") + if sender.hasPermission("utils.lol.modify"): + msg(sender, "&a/lol add &eAdd message") + msg(sender, "&a/lol del &eDelete message") + else: + noperm(sender) return True -- 2.45.2 From 33693233d2f54d45e62f5dab0d56bbcc221d7b09 Mon Sep 17 00:00:00 2001 From: Logan Fick <587ml873m0poe2s1pjsmx3vi37tn5p@gmail.com> Date: Fri, 14 Aug 2015 11:09:49 -0400 Subject: [PATCH 2/3] Add missing tab Woops... --- saylol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saylol.py b/saylol.py index 0bd47fd..1ccce16 100644 --- a/saylol.py +++ b/saylol.py @@ -104,5 +104,5 @@ def on_lol_command(sender, command, label, args): msg(sender, "&a/lol add &eAdd message") msg(sender, "&a/lol del &eDelete message") else: - noperm(sender) + noperm(sender) return True -- 2.45.2 From df28ac87a69f14444498722e2b30a18290bed53e Mon Sep 17 00:00:00 2001 From: Logan Fick <587ml873m0poe2s1pjsmx3vi37tn5p@gmail.com> Date: Fri, 14 Aug 2015 11:40:07 -0400 Subject: [PATCH 3/3] Make help dialogue only show commands you have perms to --- reports.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reports.py b/reports.py index f4462e7..a7b2b67 100644 --- a/reports.py +++ b/reports.py @@ -19,7 +19,8 @@ def print_help(sender): msg(sender, " &2/rp tp &eTeleport to report's location & show details") msg(sender, " &2/rp close &eResolve an open report") msg(sender, " &2/rp reopen &eReopen a resolved report") - msg(sender, " &2/rp del &eDelete a report (admin only)") + if sender.hasPermission(rp_permission + ".del"): + msg(sender, " &2/rp del &eDelete a report") def print_list(sender, closed): @@ -197,4 +198,4 @@ def get_reports(closed): def get_reporter(report): return server.getOfflinePlayer(juuid(report["uuid"])) -thread.start_new_thread(reports_reminder, ()) \ No newline at end of file +thread.start_new_thread(reports_reminder, ()) -- 2.45.2