SShortSingh.
Back to feed

Practical Guide to Building Robust Permissions and Authorisation Systems

0
·45 views

A technical playbook outlines best practices for designing authorisation as a core domain capability rather than scattered endpoint conditionals. It distinguishes between authentication (verifying identity), authorisation (deciding whether a verified principal may act on a resource), and business-rule validation, emphasising these are separate concerns. Every access decision should be expressed as whether a principal can perform a specific action on a resource within a defined context, using business-oriented action names rather than HTTP verbs. The guide recommends starting with no access by default and adding narrow, justified grants, while reserving explicit prohibitions for non-negotiable guardrails such as suspended accounts or cross-tenant access. It advises choosing the simplest server-side enforcement model that works, introducing a policy engine only when rules need to be expressive, auditable, or shared across multiple services.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Former contractor's lingering cloud account leads to leak of unreleased product plans

A small crowdfunding company in Japan discovered that its unreleased product plans had surfaced at a competitor just weeks before launch. Investigation of access logs revealed that a former outsourced staffer, whose contract had ended months earlier, still had active access to the company's cloud storage and had downloaded the new product materials. The contractor said they had accessed the files out of curiosity and shared them with an acquaintance, without intending harm, and the full extent of the spread could not be traced. The case highlights guidance from Japan's IPA that access rights should be revoked promptly when a contract ends, as internal-misuse leaks remain a persistent security threat. The company is now reviewing all active accounts, including those of former staff and external collaborators.

0
ProgrammingDEV Community ·

Browser-based JPEG metadata stripping removes EXIF and GPS without re-encoding

Photos from phones often embed EXIF metadata, including camera details, timestamps, and sometimes precise GPS coordinates, which can persist when files are shared through messengers, email, or cloud links. Earlier canvas-based approaches remove this data but re-encode the image, degrading quality each time. The article describes a lossless alternative that parses a JPEG's marker segments and copies all but the metadata segments (APP1, APP13, COM) byte-for-byte, leaving the compressed pixel data untouched. The method runs entirely in the browser, so nothing is uploaded, and it typically yields smaller files. The author notes that the ICC colour profile in APP2 should be kept to avoid dulling wide-gamut images, and that a production implementation needs extra checks for padding bytes and segment lengths.

0
ProgrammingDEV Community ·

Markup vs margin: the pricing error that quietly erodes marketplace profit

A common mistake among small sellers is confusing markup, which measures profit against cost, with margin, which measures profit against price. The article notes that marketplace and payment fees are charged on the sale price, so a seemingly healthy markup can leave very little profit. Using an illustrative fee stack of 13% plus a $0.30 fixed fee, a $26 price for a $20 item yields only about a 9% margin instead of the intended 30%. Solving for the price that delivers a 30% margin gives roughly $35.62. The author also shows that a 20% discount can cut profit by more than half, and that discounts beyond about 34% lead to losses on each sale.

0
ProgrammingDEV Community ·

Why AI search answers rarely match the exact question you typed

AI assistants with web search often split a user's question into several smaller queries rather than searching the exact phrasing. Each sub-query is run against a search index, the top pages are fetched, and relevant passages are extracted. The model then synthesizes one answer, sometimes citing the sources it used. This process, called query fan-out, means a page can be cited for a broad question even without ranking highly for the main keyword. Content owners are advised to map likely sub-questions to clearly headed sections with direct answers up front.