Apps · contract
Permissions and app-to-app calls.
A permission request is not a grant. A capability is not a contribution. Apps talk to each other only through the platform, which knows the caller, installation, account and current consent.
The model
| Term | Meaning |
|---|---|
| Permission | A declared need with a scope. The platform decides whether it is granted. |
| Grant | An explicit decision for a subject, permission, scope, resource and validity. |
| Capability | A named operation an installed app provides to other apps. |
| Bridge method | A versioned message such as os.info or os.capabilities.invoke. |
Permission scopes
| Scope | Use |
|---|---|
app-private | Data owned by one installation only |
user-own | Resources belonging to the current account |
user-selected | The user picks the exact resources or origin |
explicit | A grant names concrete resource keys |
family-shared | A shared family/resource boundary |
system | Platform-level policy; never inferred from a UI mode |
An explicit grant must contain resources. A system grant must not be narrowed to resources. The platform validates both.
The OS permission catalog
Permissions in the OS-owned rumahl. namespace are a fixed contract. Third-party apps may request their own publisher namespace, but they cannot invent a new OS-owned id.
| Permission | Allowed scopes | Purpose |
|---|---|---|
rumahl.files.read | user-selected, explicit | Read personal files the user selected |
rumahl.files.write | user-selected, explicit | Write personal files the user selected |
Declare permissions
"permissions": [
{ "id": "com.rumahl.os.window", "scope": "user-own", "required": true, "reason": "Control its own window" },
{ "id": "com.rumahl.os.settings", "scope": "app-private", "required": true },
{ "id": "com.rumahl.os.network", "scope": "user-selected", "required": true },
{ "id": "com.rumahl.os.capabilities", "scope": "user-own", "required": true },
{ "id": "rumahl.files.read", "scope": "user-selected", "required": false }
]
A required permission must be resolved for installation to continue. An optional permission can remain ungranted; the app must handle the denial.
Grants and consent
| Route | Purpose |
|---|---|
GET /api/v1/shell/apps/{id}/grants | Read requested grants and current decisions |
PUT /api/v1/shell/apps/{id}/grants | Issue explicit consent |
DELETE /api/v1/shell/apps/{id}/grants/{grant} | Revoke one grant |
GET/PUT/DELETE /api/v1/shell/apps/{id}/network/consent | List, approve or revoke an origin consent |
A grant can be durable or bound to the current browser session. Revocation takes effect on the next authorization check; do not reuse a cached private response.
Bridge capabilities and methods
The bridge is versioned rumahl.bridge.v1. The shell binds the channel to the concrete iframe.contentWindow; an app has an opaque origin and never receives the shell session token.
| Capability | Methods |
|---|---|
com.rumahl.os.info | os.info |
com.rumahl.os.theme | os.theme.get, theme updates via os.theme.changed |
com.rumahl.os.notification | os.notification |
com.rumahl.os.window | os.window.close, minimize, focus |
com.rumahl.os.capabilities | os.capabilities.invoke |
com.rumahl.os.settings | os.settings.get, os.settings.set |
com.rumahl.os.network | os.net.request |
com.rumahl.os.warnings | os.warnings.register, publish, test, clear |
rumahl.files.read / write | os.files.request, read, write |
A method the app did not declare is refused. The shell does not fall back to a broad baseline for a modern manifest.
Talking to another app
Apps never open a direct channel to each other. The interaction has four parts:
The provider declares a capability
The signed manifest lists it in providedCapabilities. This says what the app can serve; it does not grant anything.
The provider registers a handler
Inside its hosted window it calls rumahl.provide(capability, handler) through the bridge client.
The caller declares the capability permission
It requests com.rumahl.os.capabilities. The platform checks the live account, session and installation.
The platform delivers the call
For a running web provider, the shell delivers provider.invoke to its frame and returns the result. An always-on service uses the persistent rumahl.channel.v1 channel.
import { connectRumahlBridge } from "@rumahl/bridge-client";
const rumahl = connectRumahlBridge();
await rumahl.ready();
// Provider: declare a handler for a capability in the signed manifest.
rumahl.provide("com.example.notes.search", async (invocation) => {
return searchNotes(invocation);
});
// Caller: ask the platform, never the provider window.
const result = await rumahl.invokeCapability("com.example.notes.search", {
namespace: "com.example.notes",
kind: "query",
key: "monstera"
});
Denial and debugging
| Symptom | What to check |
|---|---|
403 on a capability call | Caller permission, provider declaration, live installation and session |
| Method refused | The app did not declare the capability for that bridge method |
| Provider not found | The provider is installed but not running; retry or open it |
| Network denial | The exact origin is not approved, or consent was revoked |
| File denial | The grant is missing, expired, or scoped to different resources |
Do not infer success from a rendered control. Log the denial reason and offer the consent or retry path that matches it.
Next
- Hosting and bridge — leases and isolation.
- App packages — manifest fields.
- SDKs and npm — bridge client, contracts and install steps.
Was this page helpful?