Permissions & Roles
Control access with permission lemmas
/
Permission System
Lemma supports fine-grained permissions through "permission lemmas" - credentials that grant specific access levels.
Permission Types
| Permission | Description | Use Case |
|---|---|---|
basic |
Basic authentication | Regular users |
developer |
Developer access | Site owners, API access |
admin |
Administrative access | Platform administrators |
Checking Permissions
JavaScript
// Get all permission credentials
const permissions = await wallet.getCredentials({ type: 'permission' });
// Check if user has specific permission
const hasDeveloper = await wallet.hasPermission('developer');
// Get permission level
const level = await wallet.getPermissionLevel();
console.log('User permission level:', level);