mkevenaar / mkevenaar/CharlieSpring

`elevatedPerms` should be used as constant object (currently unused)

Open
#109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3
Forks
0
Avg merge
11h 9m
Merged PRs (30d)
26

Description

The elevatedPerms is not used right now. Instead strings are used:
https://github.com/mkevenaar/CharlieSpring/blob/ecb4a42c826a9f97f7e927c4d85e7299ace6703d/src/commands/fun/whois.js#L21
and the problem occurrence:
https://github.com/mkevenaar/CharlieSpring/blob/ecb4a42c826a9f97f7e927c4d85e7299ace6703d/src/commands/fun/whois.js#L71

Expected Behavior

Strings can cause typos and this is not checked by IDE.

Current Behavior

Permission typos will not cause a 'squiggly line' in your IDE (yes in Javascript)

Possible Solution

Use the elevatedPerms as key-value object (not as array)

Steps to Reproduce (for bugs)

Not appl.

Context

Dev PR Review #105

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/commands/fun/whois.js at the referenced lines 21 and 71, then locate the existing elevatedPerms definition. Replace the permission string references with the constant object's keys as described, and verify that the permission checks consistently use elevatedPerms without changing their behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
authorization
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.