An algorithm is a set of computable steps used to achieve an outcome. It takes input, follows rules and produces an answer or action. In a company portal, an algorithm can decide whether a person may download an invoice. The policy expresses a business condition, and the application checks it for every relevant request.

The input, decision and result

For the invoice example, the inputs might include the authenticated identity, customer account, document and available permissions. The application checks whether the document belongs to the selected account and whether the identity has viewing rights. The result is an access decision. Once access is confirmed, the application can deliver the document according to the business's retention and delivery rules.

A rule can have several conditions and cover situations where data is missing. For example, a document may be a draft or belong to another customer. Company policy determines which role can see it in each state. The user-facing message should give enough information to guide the next step, while diagnostic information for the team can remain in a protected log.

A person arranges cards on a desk into a sequence of decisions
Rules and decision branches represented by cards.
RequestCondition observedResult
Download an invoiceThe account and document match and the role can view the invoiceAccess allowed
Download an invoiceDocument from a different account in the current organization contextAccess denied
Download after access is revokedViewing rights have been withdrawnAccess denied

An example from an invoice portal

Imagine a consulting company with a portal for invoices and contracts. Ana is an administrator for Client One and a regular user for Client Two. If Ana requests an invoice for Client One while using that account, the application checks her role and the document's state. If she switches organizations in the interface, the request is evaluated for the new account. The same user can have different rights depending on the resource and their membership.

For a client who wants to delegate access to an accountant, decide what happens when access is withdrawn. In this example, when the person loses viewing rights for an organization, the next request should be evaluated using the current permissions. Discuss this requirement before implementation. A simple test can grant the right, confirm viewing, withdraw the right and check the outcome after the change.

The difference between an algorithm, a program and a rule

A program can use several algorithms in one workflow. The portal might sort documents by date, check permissions and prepare a file for download. The business rule says who may view an invoice. The algorithm defines the checks that turn that rule into a decision. The code is the implementation that runs in the application and needs to be checked alongside the sources of its data.

Some applications use algorithms that include probabilistic elements. For an authorization decision, the team needs to explain the result through permissions, state and policies. If the process also includes a risk score, document separately how that score affects the outcome. A risk estimate and a granted permission serve different roles in the workflow.

How to check that the rule was implemented correctly

Write down several combinations with expected results. Include an authorized account, an expired right, a document belonging to another organization and a document whose state is unclear. Check the result in a test environment using demonstration data. If a condition is ambiguous, speak to the person who owns the process before deciding how the application should behave.

A decision diagram and examples with expected outcomes can stay useful long after launch. When a role or document type is added, the team can revisit the same situations and extend the checks. A change to the business rule then becomes a measurable change in how the application behaves.

In projects with multiple organizations, Web Hat can review application access controls using the company's roles, documents and scenarios. The table of expected outcomes gives the team a reference for the review.