Skip to content
Draft

Dev #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 64 additions & 229 deletions custom_components/rbac/__init__.py

Large diffs are not rendered by default.

40 changes: 0 additions & 40 deletions custom_components/rbac/access_control.yaml

This file was deleted.

342 changes: 61 additions & 281 deletions custom_components/rbac/services.py

Large diffs are not rendered by default.

192 changes: 102 additions & 90 deletions custom_components/rbac/www/config.js

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions frontend/src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ export function App() {
} else {
setLoading(true);
}
console.log('Starting to load data...');

const auth = await getHAAuth();
console.log('Auth result:', auth);

if (!auth) {
setIsAuthenticated(false);
Expand All @@ -143,7 +140,6 @@ export function App() {
setSensors(sensorsData);
}

console.log('Making API calls...');
const [usersRes, domainsRes, entitiesRes, servicesRes, configRes] = await Promise.all([
makeAuthenticatedRequest('/api/rbac/users'),
makeAuthenticatedRequest('/api/rbac/domains'),
Expand All @@ -152,8 +148,6 @@ export function App() {
makeAuthenticatedRequest('/api/rbac/config')
]);

console.log('API responses:', { usersRes, domainsRes, entitiesRes, servicesRes, configRes });

// Check for admin access denied (403)
if (usersRes.status === 403 || domainsRes.status === 403 || entitiesRes.status === 403 ||
servicesRes.status === 403 || configRes.status === 403) {
Expand Down Expand Up @@ -201,7 +195,6 @@ export function App() {
configRes.json()
]);

console.log('Loaded data:', { users, domains, entities, services, config });
setData({ users, domains, entities, services, config });
setIntegrationConfigured(true);

Expand Down Expand Up @@ -343,7 +336,6 @@ export function App() {

if (response.ok) {
const userData = await response.json();
console.log('Current user data received:', userData);
return userData;
}
return null;
Expand Down Expand Up @@ -908,7 +900,7 @@ export function App() {
</Tooltip>
{frontendBlocking && (
<span style={{ fontSize: '12px', color: '#999', fontStyle: 'italic' }}>
Add frontend script to www/community/rbac/rbac.js
Add frontend script to /api/rbac/static/rbac.js
</span>
)}
</div>
Expand Down Expand Up @@ -1054,6 +1046,7 @@ export function App() {
data={data}
onSuccess={showSuccess}
onError={showError}
onDataChange={setData}
/>
</Collapse.Panel>

Expand Down
Loading