title: DiscordAPIError: Missing Access on createOverwrite
body: <br />
  Developing a discord moderation bot with Discord.js<br />
  Facing error "DiscordAPIError: Missing Access"
  <p>My bot user, which has all server permissions except &quot;Administrator&quot;, and highest.rawPosition is 18 (highest of all roles) :</p>
  <pre><code>user: ClientUser {
      id: 'XXXXXXXXX',
      bot: true,
      username: 'Bot',
      discriminator: '1863',
      avatar: '2e8af5cccdc5cf15a0f88818dbb044e6',
      lastMessageID: null,
      lastMessageChannelID: null,
      verified: true,
      mfaEnabled: true,
      _typing: Map {}
    },
  </code></pre>
  <p>is trying to add this role (rawPosition is 2) :</p>
  <pre><code>Role {
    id: 'XXXXXXXXX',
    name: 'Mod',
    color: 0,
    hoist: false,
    rawPosition: 2,
    permissions: Permissions { bitfield: 37211712 },
    managed: false,
    mentionable: false,
    deleted: false
  }
  </code></pre>
  <p>as an overwrite permission to this channel :</p>
  <pre><code>CategoryChannel {
    type: 'category',
    deleted: false,
    id: 'XXXXXXXXX',
    name: 'Section Job',
    rawPosition: 6,
    parentID: null,
  }
  </code></pre>
  <p>using this code :</p>
  <pre><code>await channel.createOverwrite(role, {
     VIEW_CHANNEL: true,
     READ_MESSAGES: true,
     SEND_MESSAGES: true,
     CONNECT: true
  });
  </code></pre>
  <p>Here is the error I get :</p>
  <pre><code>[2020/10/06 00:52:56:427] DiscordAPIError: Missing Access
  </code></pre>
  <p>I performed a search before posting this.
  Discord gives many possible explanations about this specific error, and none would fit with my issue : <a href="https://discordjs.guide/popular-topics/permissions-extended.html#missing-permissions" rel="nofollow noreferrer">https://discordjs.guide/popular-topics/permissions-extended.html#missing-permissions</a></p>
  <pre><code>Your bot is missing the needed permission to execute this action in it's calculated base or final permissions (requirement changes based on the type of action you are trying to execute).
  --&gt; My bot has all permissions except &quot;Administrator&quot;
  You provided an invalid permission number while trying to create overwrites. (The calculator on the apps page returns decimal values while the developer documentation lists the flags in hex. Make sure you are not mixing the two and don't use the hex prefix 0x where not applicable)
  --&gt; I give the exact same permissions, formatted exactly the same as another group, and it works
  It is trying to execute an action on a guild member with a role higher than or equal to your bots highest role.
  --&gt; Not executing an action on a user, but on a group
  It is trying to modify or assign a role that is higher than or equal to its highest role.
  --&gt; Bot highest role is 18, and added role rawPosition is 2
  It is trying to add a managed role to a member.
  --&gt; As you can see it is not &quot;managed&quot;
  It is trying to remove a managed role from a member.
  --&gt; Not trying to remove a role
  It is trying to execute a forbidden action on the server owner.
  --&gt; Not editing a user, but a channel (and server owwner does not have this role)
  It is trying to execute an action based on another unfulfilled factor (for example reserved for partnered guilds).
  --&gt; I don't understand this one but it couldn't be that
  It is trying to execute an action on a voice channel without the VIEW_CHANNEL permission.
  --&gt; Not executing an action on a voice channel, but on a Category channel, and it has VIEW_CHANNEL permission
  </code></pre>
  <p>More information :<br />
  1/ The same command in the exact same context works with some other groups, like this one :</p>
  <pre><code>Role {
      id: 'XXXXXXXXX',
        name: 'Job',
        color: 0,
        hoist: false,
        rawPosition: 1,
        permissions: Permissions { bitfield: 37211712 },
        managed: false,
        mentionable: false,
        deleted: false
  }
  </code></pre>
  <p>2/ The same command works with &quot;Administrator&quot; permission assigned to the bot<br />
  3/ Of course, adding &quot;Administrator&quot; permission to the bot is not an option</p>
  <p>Thanks for any help !</p>