Code Explainers

Code explainers tagged #authorization

javascript
'use server'
 
import { revalidatePath } from 'next/cache'
import { redirect } from 'next/navigation'

How a Next.js Server Action updates a post

server-actions authorization validation
Intermediate 7 steps
php
<?php
 
namespace App\Policies;
 

How authorization policies gate updates in Laravel

authorization policies access control
Intermediate 7 steps
php
<?php
 
namespace App\Http\Requests;
 

How a Laravel FormRequest validates input

validation form-request input-sanitization
Intermediate 6 steps
ruby
class ArticlesController < ApplicationController
  before_action :authenticate_user!
  before_action :set_article, only: %i[show edit update destroy]
  before_action :authorize_owner!, only: %i[edit update destroy]

How before_action filters guard a Rails controller

filters authorization callbacks
Intermediate 9 steps