<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="362365" data-post-id="362365">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Pal" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Pal
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>update phoenix dep, install tailwind 4, &amp; vendor daisy<br>
I followed this repo: <a href="https://github.com/Gazler/dayzee/blob/master/assets/css/app.css" class="inline-onebox" rel="noopener nofollow ugc">dayzee/assets/css/app.css at master · Gazler/dayzee · GitHub</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362365" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/76">Post #75</a>
	                </div>
	            </div>
              <div id="likers-container-362365" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362365"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #75"></div>
  </section>
</div>
    <div class="postbit" id="362394" data-post-id="362394">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cvkmohan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/120/39944_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cvkmohan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am still a bit confused on the implementation of scopes. Sorry, if the question looks dumb. Most of the times, what the user can see depends on not just the user_id - but - the community in which he is a member of. For example, in a course - what teacher can see versus what student can see might be different. In an organization, what a manager can see versus what an operator can see might be different. What would be the case where one wants to see only the records that he created? I mean, suppose, we are building an ERP - showing only the records entered by the same operator - will not lead to any meaningful result. Is it that, in all such cases, scope is not useful?<br>
Or are we saying that we do what is suggested in “augmenting scope” - and - extend it to organization? Just extending it to organization will not be sufficient then also - in the organization, what role he plays will determine what he can see. So, do we enhance the scope to include organization and role? And the augmented scope for organization takes care of filtering?<br>
What conveniences scope will bring in such cases? I am a bit confused. Ofcourse, as a systems’ builder I can feel the advantage. Unsure, how to put it into practical programming.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362394" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/77">Post #76</a>
	                </div>
	            </div>
              <div id="likers-container-362394" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362394"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #76"></div>
  </section>
</div>
    <div class="postbit" id="362395" data-post-id="362395">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="steffend" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/steffend/120/20548_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  steffend
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Phoenix Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="cvkmohan" data-post="77" data-topic="70256">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/48/39944_2.png" class="avatar"> cvkmohan:</div>
<blockquote>
<p>Just extending it to organization will not be sufficient then also - in the organization, what role he plays will determine what he can see. So, do we enhance the scope to include organization and role? And the augmented scope for organization takes care of filtering?</p>
</blockquote>
</aside>
<p>Exactly. The idea of the scope struct is to provide a well-defined data structure that contains all the information that you need to render your page. So if your application has different user roles that decide what should be visible and what not, this information should be in the scope. For example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">%MyApp.Scope{user: ..., tenant_id: 12345, role: :teacher}
</code></pre>
<p>And in your Controllers / LiveViews, but, you can use <code>@current_scope.role</code> assign to differentiate if someone is a student or teacher.</p>
<p>Instead of a “role”, you might also store a list of permissions, etc.; but this is highly specific to the actual application that you’re building.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362395" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/78">Post #77</a>
	                </div>
	            </div>
              <div id="likers-container-362395" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362395"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #77"></div>
  </section>
</div>
    <div class="postbit" id="362396" data-post-id="362396">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="camcaine" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/camcaine/120/5434_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  camcaine
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So are scopes analogous to Current/CurrentAttributes in rails?<br>
Feels like they serve a similar purpose. Which is cool if so.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362396" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/79">Post #78</a>
	                </div>
	            </div>
              <div id="likers-container-362396" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362396"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #78"></div>
  </section>
</div>
    <div class="postbit" id="362397" data-post-id="362397">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>They are indeed!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362397" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/80">Post #79</a>
	                </div>
	            </div>
              <div id="likers-container-362397" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362397"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #79"></div>
  </section>
</div>
    <div class="postbit" id="362444" data-post-id="362444">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="AlchemistCamp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/AlchemistCamp/120/8823_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  AlchemistCamp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I generally try to avoid ever tying authorization directly to a user. It’s much more flexible to allow each resource to be accessed by a list of groups (where each group can represent an organization, a role, an ad-hoc collection of users or just an individual).</p>
<p>Prior to the introduction of scopes, my auth setups have generally involved running an auth function that fetched the list of approved groups for a resource and action (both of which are available from the socket) and then allowing access if and only if the logged in user was a member of one of those groups. This is very flexible since it allows both adding or removing groups allowed to access a resource as well as changing the updating the composition of those groups as people join and leave organizations and roles.</p>
<p>As I understand them so far, scopes somewhat reverse this conceptually so that instead of thinking about who is allowed to perform a given action, you’re thinking about what actions the logged in user is allowed to perform.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362444" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/81">Post #80</a>
	                </div>
	            </div>
              <div id="likers-container-362444" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362444"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #80"></div>
  </section>
</div>
    <div class="postbit" id="362451" data-post-id="362451">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I don’t think you can intercept :handle_info, but you should be able to intercept :handle_event.</p>
<p>I think it may be useful from the macro use case that you provided as example code, in fact I have a similar one that I could probably refactor to use life cycle hook. The example in the linked documentation also shows how we can avoid creating stateful components to respond to :handle_event <a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#attach_hook/4-sharing-event-handling-logic" class="inline-onebox" rel="noopener nofollow ugc">Phoenix.LiveView — Phoenix LiveView v1.2.5</a></p>
<p>I guess this may be helpful from performance side of things, but the downside is that you now have to explicitly attach your callbacks in LiveView and it’s not something a LiveComponent down the tree of components can do on their own.</p>
<p>Even with macro, I don’t think a macro itself can anymore attach these lifecycle hooks, it needs to be attached from something like <code>mount</code> function in the parent LiveView, so the macro no longer is self-contained and requires the programmer to do two things: use macro and then hook the callbacks from <code>mount</code> function.</p>
<p>We probably also may need to end up with life cycle hooks being attached to parent LiveView that handle actions from components that we don’t even have rendered at given time. LIke, there’s some sort of “edit” button on a leaf component somewhere deep in the render tree and it’s not present on the page until you click that “edit” button. A row turns to editable variant once clicked and now you need to handle the events but we didn’t have to do it before. This requires the programmer to know a lot what can be happening during the program life cycle, and understand how the stack of components works and what needs to be attached and when, versus black-box approach provided by self-contained components known from, for example React.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362451" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/82">Post #81</a>
	                </div>
	            </div>
              <div id="likers-container-362451" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362451"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #81"></div>
  </section>
</div>
    <div class="postbit" id="362452" data-post-id="362452">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hubertlepicki" data-post="82" data-topic="70256">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/48/6822_2.png" class="avatar"> hubertlepicki:</div>
<blockquote>
<p>I don’t think you can intercept :handle_info</p>
</blockquote>
</aside>
<p>You can:</p>
<blockquote>
<p>Use <a rel="nofollow"><code>attach_hook/4</code></a> on any of the following lifecycle stages: <code>:handle_params</code> , <code>:handle_event</code> , <code>:handle_info</code> , <code>:handle_async</code> , and <code>:after_render</code> . To attach a hook to the <code>:mount</code> stage, use <a rel="nofollow"><code>on_mount/1</code></a>.</p>
</blockquote>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://phoenix-live-view.hexdocs.pm/1.0.9/Phoenix.LiveView.html">
  <header class="source">

      <a href="https://phoenix-live-view.hexdocs.pm/1.0.9/Phoenix.LiveView.html" target="_blank" rel="noopener nofollow">phoenix-live-view.hexdocs.pm</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://phoenix-live-view.hexdocs.pm/1.0.9/Phoenix.LiveView.html" target="_blank" rel="noopener nofollow">Phoenix.LiveView — Phoenix LiveView v1.0.9</a></h3>



  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362452" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/83">Post #82</a>
	                </div>
	            </div>
              <div id="likers-container-362452" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362452"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #82"></div>
  </section>
</div>
    <div class="postbit" id="362456" data-post-id="362456">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hubertlepicki" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/120/6822_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hubertlepicki
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh I misunderstood the docs then. Interestingly use cases for this one.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362456" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/84">Post #83</a>
	                </div>
	            </div>
              <div id="likers-container-362456" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362456"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #83"></div>
  </section>
</div>
    <div class="postbit" id="362466" data-post-id="362466">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="cvkmohan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/cvkmohan/120/39944_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  cvkmohan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I guess for the first time in phoenix release history, we are getting into a release, where library maintainers have to do some homework. If your library contains anything visual, (most libraries do) - you are going to get into a release where you have to specify that your library will not work properly for phoenix 1.8.<br>
Assuming we have a library built for &lt;1.8, most likely it will be styled using tailwind - and - now - with default daisyui for phoenix 1.8, the library will not work properly - atleast the colors part of it. Further, from now on all the library maintainers have to maintain atleast 2 versions of the UI - one with plain tailwind - and - another with daisyui.<br>
Any ideas, recommendations or suggestions for the best way forward?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="362466" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/phoenix-1-8-0-rc-0-released/70256/85">Post #84</a>
	                </div>
	            </div>
              <div id="likers-container-362466" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="362466"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #84"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/70256/load_more?page=9">Load more posts (87 remaining)</a>
</div></template></turbo-stream>