46d59b48b5
Updated all GitHub URLs from cpfarhood to privilegedescalation organization: - Repository URLs in package.json and Artifact Hub metadata - Documentation links and references - Git remote updated No functional changes - this is purely an organizational migration. Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1.1 KiB
1.1 KiB
Headlamp Sealed Secrets API v0.2.0
Headlamp Sealed Secrets API / hooks/usePermissions / usePermission
Function: usePermission()
usePermission(
namespace,permission):object
Defined in: src/hooks/usePermissions.ts:79
Hook to check a specific permission
Useful when you only need to check one permission (e.g., canCreate) instead of fetching all permissions.
Parameters
namespace
string
Optional namespace to check
permission
keyof ResourcePermissions
Permission key to check
Returns
object
Object with loading state and allowed flag
loading
loading:
boolean
allowed
allowed:
boolean
Example
const { loading, allowed } = usePermission('default', 'canCreate');
if (allowed) {
// Show create button
}