Skip to content

Commit

Permalink
Prefix permission with plugin name
Browse files Browse the repository at this point in the history
blame 🅱️oggit
  • Loading branch information
Heisenburger69 committed Jun 24, 2020
1 parent f321b5f commit 1fc865a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ A list of Timezone abbreviations can be found at https://en.wikipedia.org/wiki/L
### Commands:
There is only one command /currenttime with the aliases /ct and /servertime
### Permissions:
Players can be given the permission node "currenttime.view" to be able to use /currenttime
Players can be given the permission node "burgertimezones.command" to be able to use /currenttime
6 changes: 6 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: BurgerTimezones
version: 1.0.0
main: Heisenburger69\BurgerTimezones\Main
api: 3.0.0
permissions:
burgertimezones.command:
default: true
description: Allow users to execute /currenttime

description: Simple plugin allowing players to view the current time with respect to different timezones
author: Heisenburger69
website: github.com/Heisenburger69
...
4 changes: 2 additions & 2 deletions src/Heisenburger69/BurgerTimezones/CurrentTimeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CurrentTimeCommand extends Command implements PluginIdentifiableCommand
public function __construct(string $name, string $description = "", string $usageMessage = null, array $aliases = [])
{
parent::__construct($name, $description, $usageMessage, $aliases);
$this->setPermission("currenttime.view");
$this->setPermission("burgertimezones.command");
}

/**
Expand All @@ -32,7 +32,7 @@ public function __construct(string $name, string $description = "", string $usag
*/
public function execute(CommandSender $sender, string $commandLabel, array $args): void
{
if(!$sender->hasPermission("currenttime.view")) {
if(!$sender->hasPermission("burgertimezones.command")) {
$sender->sendMessage(C::RED . "You do not have permission to use this command.");
return;
}
Expand Down

1 comment on commit 1fc865a

@jasonw4331
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some problems with the plugin submission form for "BurgerTimezones" (v1.0.0 submitted on 2020-06-24T11:35:13.000Z):

D1 — Detailed description:

The description should give an idea what the plugin is about, why it is useful, etc. Do not assume everyone knows the terminology; explain them. Do not just post screenshots or videos without explaining with text; videos are not searchable.

Your release has been reset to draft. Please edit the release to resolve these problems, then click "Submit" on the edit page to have the plugin reviewed again.

This comment is posted here because this is the last commit when the released build was created.

Please sign in to comment.