bastion

Understanding Authorization and Permissions

Build this skill

Decide the minimum permissions and access restrictions each job needs, applying least privilege to people, programs and access requests.

The intern who could open everything

When Riya Menon's account was set up, the quickest option was to copy an administrator's account, so for her first week she could open the staff salary sheet, change prices in MedLedger and delete supplier invoices from the shared drive. She needed none of it; her project was a stock report. Nothing went wrong, but one stolen password or one careless click on her account would have reached the most sensitive data Tulsi Health holds. The system had checked correctly that it was Riya. What it got wrong was the next question, what Riya should be allowed to do, and answering that question is called authorization.

Who, what and which action

Authorization happens after you have proved who you are, and it happens again on every request you make. Each request has three parts. There is who is asking, the proven identity. There is what they want to reach, called a resource: a file, a folder, a screen in MedLedger, a table of customer records, even a printer. And there is which action they want to perform on it, such as viewing, changing or deleting. A permission is a rule that allows one identity, or a group of identities, one action on one resource: "Farida may change prescription records".

RequestRiya: openSalariesWho?riya.menon,internprovenWhat?Staff salariesfolderWhich action?viewDecisionno rule allowsit: denyrulesNo matching permission means no

The system looks for a permission that matches all three parts. Well-built systems refuse by default, so a forgotten rule means a refused request rather than an open door.

The last step hides an important design choice. A well-built system uses default deny: if no permission matches, the answer is no. The opposite, allowing everything unless a rule forbids it, means every new folder is open to everyone until someone remembers to lock it. Think of a housing society gate: the guard lets in residents and visitors whose names are on the list, and does not let in everyone who is not on a banned list.

Permissions are verbs

User permissions are usually described by the actions they allow, and the difference between them matters a great deal. Being able to view the customer list is a privacy risk; being able to change or delete it is a much bigger one. The most powerful permission of all is the one that lets you change other people's permissions, because whoever holds it can give themselves anything else. Accounts holding it are called administrator accounts, and there should be very few of them.

Viewread, open, downloadArjun views today'sNashik Road salesEditchange or addFarida marks aprescription dispensedDeleteremove for goodSameer clears anold supplier invoiceAdministerchange who can do whatNeha only, and onlywhen she needs it

Each step up lets a mistake or an attacker do more damage. Most people need view or edit on a handful of resources, and almost nobody needs administer.

Resource access should be decided resource by resource, not as one big yes or no. Arjun can view sales for Nashik Road but not for the other stores, and he can edit his own branch's daily cash-up but not the company price list. Granting access to "the shared drive" as a whole is like handing someone the key to the whole office when they only needed the stationery cupboard.

Access restrictions: when, where and how much

Permissions answer whether an identity may perform an action at all. Access restrictions add conditions on top. A login might be allowed only during store hours, only from a Tulsi Health laptop, only from within India, or only for a limited number of records at a time, so that nobody can download all 2.4 lakh customers in one go. An account can also carry an end date: Riya's access should stop on the last day of her internship without anyone having to remember.

A hospital visitor pass shows both ideas together. The pass names the one ward you may visit, which is the permission, and the visiting hours printed on it, which are the restriction. With it you can walk into Ward 3 at five in the evening. The same pass does not open the intensive care unit, the medicine store or Ward 3 at nine at night.

VISITOR PASS Lata Gokhale visiting a relative Allowed Ward 3 only When 4 pm to 6 pm today Gate 2 · checked by guard Corridor Ward 3 ✓ door opens ICU ✕ not on the pass Medicine store ✕ staff only Ward 5 ✕ Ward 3 at 9 pm ! right ward, outside visiting hours The pass proves who she is visiting. It opens one door, for two hours, and nothing else.

The pass gives exactly one permission, Ward 3, with one restriction, visiting hours. Every other door stays shut, even for a visitor whose identity has been checked.

Restrictions are especially useful because they still help when a password is stolen. An attacker in another city at 3 am, on a laptop that is not a Tulsi Health device, fails the conditions even with the right password. Restrictions also catch mistakes, such as an export that would quietly send the whole customer list to a personal email address.

Least privilege: only what the job needs

The rule that ties all of this together is the principle of least privilege: every identity gets the smallest set of permissions it needs to do its job, and only for as long as it needs them. It applies to people, laptops and programs alike. The app's server program should be able to read and add orders, but it has no need to delete the whole customer table.

The reason is simple: permissions decide how much damage is possible when something goes wrong. If Farida's account is stolen, an attacker can reach prescriptions at the Kothrud store, which is serious; if her account had administrator rights, the same theft would reach everything. Least privilege also limits honest mistakes and malicious insiders, and it makes logs easier to read, because unusual actions stand out.

Riya's first weekCopied admin accountSalaries, prices, invoicesDelete anything on the driveSame access after she leavesLeast privilegeHer own intern accountView the stock reports onlyNo delete, no adminAccess ends on 31 December

Both versions let Riya finish her stock report. Only one of them limits the damage a stolen password or a wrong click could do.

Least privilege fails slowly, through convenience. Copying an existing account gives a new person everything that person had. Staff who move between branches keep their old access as well as the new, a drift called privilege creep. Temporary access, given for one urgent task, is never removed. The fixes are to grant access from what the job needs rather than by copying someone, to give extra access with an end date, and to check every few months that each person's access still matches their work. Too little access is a failure too, because people who cannot do their job will share passwords to get around the block.

Set the access each Tulsi Health job needs below. Every cell starts at Edit, the way Riya's copied account did, so your task is to take away what each job does not need without breaking anyone's work.

Real requests rarely arrive as a neat grid. They arrive as messages asking for a bit more access, often urgently. As Neha, decide how to answer each one.

Follow your curiosity.

↑ ↓ to explore · Enter to open · Escape to close