Implement authentication and access control
This commit is contained in:
1 parent
e1bdcda191
commit
327cb78f1a
27 files changed
+600
-167
No files matched your search
@@ -8,11 +8,14 @@ import * as store from "./store";
|
||||
import * as components from "./components";
|
||||
|
||||
function init(args) {
|
||||
return new Promise(resolve => {
|
||||
resolve({
|
||||
deviceId: args.id,
|
||||
deviceFilter: new Filter(["=", "DeviceID.ID", args.id])
|
||||
});
|
||||
if (!window.authorizer.hasAccess("devices", 2))
|
||||
return Promise.reject(
|
||||
new Error("You are not authorized to view this page")
|
||||
);
|
||||
|
||||
return Promise.resolve({
|
||||
deviceId: args.id,
|
||||
deviceFilter: new Filter(["=", "DeviceID.ID", args.id])
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user