Skip to content

feat(scope): add current Meta permissions#1662

Merged
nbartels merged 1 commit into
devfrom
chore/update-facebook-permissions
Apr 28, 2026
Merged

feat(scope): add current Meta permissions#1662
nbartels merged 1 commit into
devfrom
chore/update-facebook-permissions

Conversation

@nbartels

@nbartels nbartels commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added 13 new permission constants for Facebook, Instagram, WhatsApp, and Threads platforms, enabling support for branded content ads, creator marketplace features, enhanced messaging capabilities, content and engagement management, and business event handling.
  • Documentation

    • Updated existing permission documentation for clarity.

@nbartels nbartels self-assigned this Apr 28, 2026
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The FacebookPermissions enum is extended with 13 new permission constants spanning Facebook, Instagram, WhatsApp, and Threads platforms, each paired with appropriate category classifications. Additionally, the Javadoc for an existing Instagram permission constant is updated.

Changes

Cohort / File(s) Summary
Facebook Permissions Enum Expansion
src/main/java/com/restfb/scope/FacebookPermissions.java
Added 13 new enum constants: branded content ads, creator marketplace discovery/messaging for Facebook and Instagram, messaging utilities, app solutions, fundraiser management, WhatsApp business events, and Threads-to-Instagram sharing. Updated Javadoc for INSTAGRAM_BUSINESS_MANAGE_INSIGHTS.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐰 Hops of joy for permissions new,
Thirteen paths for me and you,
Instagram, WhatsApp, Threads so bright,
Marketplace magic, properly categorized right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(scope): add current Meta permissions' accurately describes the main change: adding new Facebook permissions constants to the FacebookPermissions enum. It is clear, specific, and directly reflects the primary purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/update-facebook-permissions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/java/com/restfb/scope/FacebookPermissions.java (1)

304-322: Add focused tests for the new permission strings to prevent silent typos.

Since ScopeBuilder serializes these via getPermissionString(), a compact test covering the newly added constants would lock in expected wire values and reduce regression risk.

✅ Suggested test addition (example)
diff --git a/src/test/java/com/restfb/scope/ScopeBuilderTest.java b/src/test/java/com/restfb/scope/ScopeBuilderTest.java
@@
   `@Test`
+  void newMetaPermissionsAreSerializedCorrectly() {
+    ScopeBuilder s = new ScopeBuilder(true);
+    s.addPermission(FacebookPermissions.FACEBOOK_BRANDED_CONTENT_ADS_BRAND)
+      .addPermission(FacebookPermissions.MARKETING_MESSAGES_MESSENGER)
+      .addPermission(FacebookPermissions.PAGES_UTILITY_MESSAGING)
+      .addPermission(FacebookPermissions.MANAGE_APP_SOLUTIONS)
+      .addPermission(FacebookPermissions.MANAGE_FUNDRAISERS)
+      .addPermission(FacebookPermissions.INSTAGRAM_CREATOR_MARKETPLACE_DISCOVERY)
+      .addPermission(FacebookPermissions.INSTAGRAM_CREATOR_MARKETPLACE_MESSAGING)
+      .addPermission(FacebookPermissions.INSTAGRAM_MANAGE_CONTENTS)
+      .addPermission(FacebookPermissions.INSTAGRAM_MANAGE_ENGAGEMENT)
+      .addPermission(FacebookPermissions.INSTAGRAM_MANAGE_UPCOMING_EVENTS)
+      .addPermission(FacebookPermissions.WHATSAPP_BUSINESS_MANAGE_EVENTS)
+      .addPermission(FacebookPermissions.THREADS_SHARE_TO_INSTAGRAM);
+
+    assertThat(s).hasToString(
+      "facebook_branded_content_ads_brand,marketing_messages_messenger,pages_utility_messaging," +
+      "manage_app_solutions,manage_fundraisers,instagram_creator_marketplace_discovery," +
+      "instagram_creator_marketplace_messaging,instagram_manage_contents,instagram_manage_engagement," +
+      "instagram_manage_upcoming_events,whatsapp_business_manage_events,threads_share_to_instagram"
+    );
+  }
+
+  `@Test`
   void multiPermissions() {

Also applies to: 476-484, 538-545, 746-763, 828-887, 1080-1088, 1251-1258

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/restfb/scope/FacebookPermissions.java` around lines 304 -
322, Add focused unit tests that assert each new FacebookPermissions enum
constant serializes to the exact expected wire string via
ScopeBuilder.getPermissionString(); for example verify
FACEBOOK_BRANDED_CONTENT_ADS_BRAND and FACEBOOK_CREATOR_MARKETPLACE_DISCOVERY
return "facebook_branded_content_ads_brand" and
"facebook_creator_marketplace_discovery" respectively. Create a compact test
(e.g., FacebookPermissionsTest) that enumerates the newly added constants
(including the other ranges called out) and compares
permission.getPermissionString() against the hard-coded expected literal for
each to catch silent typos. Ensure tests fail on mismatch and cover all newly
introduced constants referenced in the review comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/java/com/restfb/scope/FacebookPermissions.java`:
- Around line 304-322: Add focused unit tests that assert each new
FacebookPermissions enum constant serializes to the exact expected wire string
via ScopeBuilder.getPermissionString(); for example verify
FACEBOOK_BRANDED_CONTENT_ADS_BRAND and FACEBOOK_CREATOR_MARKETPLACE_DISCOVERY
return "facebook_branded_content_ads_brand" and
"facebook_creator_marketplace_discovery" respectively. Create a compact test
(e.g., FacebookPermissionsTest) that enumerates the newly added constants
(including the other ranges called out) and compares
permission.getPermissionString() against the hard-coded expected literal for
each to catch silent typos. Ensure tests fail on mismatch and cover all newly
introduced constants referenced in the review comment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d6634d0e-c6dc-4f81-a731-70c9886ebc30

📥 Commits

Reviewing files that changed from the base of the PR and between ab347da and a475a3f.

📒 Files selected for processing (1)
  • src/main/java/com/restfb/scope/FacebookPermissions.java

@nbartels
nbartels merged commit 15390b2 into dev Apr 28, 2026
4 checks passed
@nbartels nbartels added this to the 2026.4.0 milestone Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant