<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: HokaGue-Devs</title>
    <description>The latest articles on DEV Community by HokaGue-Devs (@hokague).</description>
    <link>https://dev.to/hokague</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4169742%2F0ca1314f-565d-4a51-87f9-09c75c4a02a9.png</url>
      <title>DEV Community: HokaGue-Devs</title>
      <link>https://dev.to/hokague</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hokague"/>
    <language>en</language>
    <item>
      <title>One Hook Should Decide Who You Are and What You Can Do</title>
      <dc:creator>HokaGue-Devs</dc:creator>
      <pubDate>Thu, 08 Oct 2026 09:00:01 +0000</pubDate>
      <link>https://dev.to/hokague/one-hook-should-decide-who-you-are-and-what-you-can-do-ge6</link>
      <guid>https://dev.to/hokague/one-hook-should-decide-who-you-are-and-what-you-can-do-ge6</guid>
      <description>&lt;p&gt;Most Power Platform Code Apps I've reviewed eventually accumulate two, three,&lt;br&gt;
sometimes five different places that each answer "what can this user do" -&lt;br&gt;
slightly differently every time. One hook checks a role field. A screen&lt;br&gt;
re-checks it with a different condition. A button disables itself based on a&lt;br&gt;
third rule that nobody remembers writing.&lt;/p&gt;

&lt;p&gt;By the time someone asks "can a Regional Manager delete a validated record,"&lt;br&gt;
nobody can answer with certainty - because the answer isn't in one place.&lt;/p&gt;
&lt;h2&gt;
  
  
  The invariant
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One hook answers "who am I, and what am I allowed to do." Everything else&lt;br&gt;
derives from it.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;usePermissions&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Role&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;can&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Action&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// the ONLY place that resolves identity -&amp;gt; role -&amp;gt; capability&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every screen, every button, every guard calls this hook - never its own&lt;br&gt;
re-implementation of the rule.&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding a dimension without breaking the invariant
&lt;/h2&gt;

&lt;p&gt;The moment you need a second dimension - say, permissions that also depend on&lt;br&gt;
which business entity the user is acting in - the instinct is to wire the new&lt;br&gt;
logic &lt;em&gt;into&lt;/em&gt; the existing hook. Don't. &lt;strong&gt;Compose a second hook on top of the&lt;br&gt;
first one.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;usePermissionsForEntity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entityId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;usePermissions&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="c1"&gt;// combines base.role with entity-specific rules&lt;/span&gt;
  &lt;span class="c1"&gt;// never calls back into itself - no cycle&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wiring the first hook to depend on the second (instead of composing on top)&lt;br&gt;
is how you get a circular dependency that only shows up once the app is big&lt;br&gt;
enough to hurt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is worth protecting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One audit point.&lt;/strong&gt; "What can a Regional Manager do" has exactly one
place to read, not five to reconcile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Safe to extend.&lt;/strong&gt; A new dimension (entity, project, region - whatever
your domain needs next) is a new layer on top, never a rewrite of the
foundation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Impossible to accidentally diverge.&lt;/strong&gt; A button and a screen can't
disagree about what's allowed if they both call the same function.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;I work on Power Platform / Dataverse architecture (Code Apps, permission&lt;br&gt;
models, approval workflows). Happy to discuss your project's architecture if&lt;br&gt;
you're scoping something similar.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>typescript</category>
      <category>powerplatform</category>
      <category>lowcode</category>
    </item>
    <item>
      <title>The Power Apps Code App Licensing Trap Nobody Tells You About</title>
      <dc:creator>HokaGue-Devs</dc:creator>
      <pubDate>Wed, 07 Oct 2026 19:55:01 +0000</pubDate>
      <link>https://dev.to/hokague/the-power-apps-code-app-licensing-trap-nobody-tells-you-about-1knp</link>
      <guid>https://dev.to/hokague/the-power-apps-code-app-licensing-trap-nobody-tells-you-about-1knp</guid>
      <description>&lt;p&gt;If you're building a Power Apps Code App (React + TypeScript + Dataverse), there's&lt;br&gt;
one requirement that can kill an otherwise finished project: every end user needs&lt;br&gt;
a Power Apps &lt;strong&gt;Premium&lt;/strong&gt; per-user license.&lt;/p&gt;

&lt;p&gt;Not a per-app license. Not a free tier. A &lt;strong&gt;Premium&lt;/strong&gt; license, per person, for&lt;br&gt;
every single user who will open the app.&lt;/p&gt;

&lt;p&gt;This sounds obvious once you say it out loud - but it's easy to miss during&lt;br&gt;
scoping, especially when the business asks for "an app for everyone in the&lt;br&gt;
company." I've seen this surface &lt;em&gt;after&lt;/em&gt; an application was fully built,&lt;br&gt;
tested, and approved by the business: the project was technically done, and&lt;br&gt;
licensing is what put it on hold.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters more than it seems
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Power Apps Code Apps run on Dataverse, and Dataverse access via a custom
app isn't covered by the free/basic tiers most organizations already have
for Microsoft 365.&lt;/li&gt;
&lt;li&gt;The cost scales with headcount, not with app complexity. A simple
five-screen app for 2,000 employees can be far more expensive to license
than a complex app for 50 people.&lt;/li&gt;
&lt;li&gt;Procurement and budget approval for licensing often takes &lt;strong&gt;longer&lt;/strong&gt; than
building the app itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to do instead
&lt;/h2&gt;

&lt;p&gt;Ask this question &lt;strong&gt;before writing the first line of code&lt;/strong&gt;, not during UAT:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Who exactly will use this app, and do they already hold a Power Apps&lt;br&gt;
Premium license for another reason?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the answer is "everyone in the company" or "we don't know yet," that's your&lt;br&gt;
signal to escalate licensing to a budget conversation immediately - not a&lt;br&gt;
technical one. A project that's code-complete but licensing-blocked is a&lt;br&gt;
worse outcome than a project that never started, because by then the&lt;br&gt;
business has already committed expectations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;Technical excellence doesn't protect a project from a licensing model nobody&lt;br&gt;
priced in. If you're scoping a Power Platform Code App, put the licensing&lt;br&gt;
question in the very first round of requirements - right next to "how many&lt;br&gt;
levels does the approval workflow have."&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I work on Power Platform / Dataverse architecture (Code Apps, Power Automate,&lt;br&gt;
approval workflows, multi-entity permission models). Happy to discuss your&lt;br&gt;
project's architecture if you're scoping something similar.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>powerplatform</category>
      <category>powerapps</category>
      <category>lowcode</category>
      <category>microsoft</category>
    </item>
  </channel>
</rss>
