mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
dev: obtain driver permission from system user
This commit is contained in:
parent
ab156297a7
commit
d1261460ba
@ -88,7 +88,7 @@ const implicit_user_app_permissions = [
|
||||
];
|
||||
|
||||
const implicit_user_permissions = {
|
||||
'driver': {},
|
||||
// 'driver': {},
|
||||
};
|
||||
|
||||
class PermissionRewriter {
|
||||
|
@ -91,7 +91,6 @@ class DriverService extends BaseService {
|
||||
try {
|
||||
return await this._call(...a);
|
||||
} catch ( e ) {
|
||||
console.error(e);
|
||||
return this._driver_response_from_error(e);
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,13 @@ const { Sequence } = require("../../codex/Sequence");
|
||||
const { get_user } = require("../../helpers");
|
||||
const { Actor, UserActorType } = require("../../services/auth/Actor");
|
||||
|
||||
|
||||
|
||||
module.exports = new Sequence([
|
||||
async function grant_if_system (a) {
|
||||
const { actor } = a.values();
|
||||
if ( actor.type.user.username === 'system' ) {
|
||||
return a.stop({});
|
||||
}
|
||||
},
|
||||
async function rewrite_permission (a) {
|
||||
let { permission } = a.values();
|
||||
permission = await a.icall('_rewrite_permission', permission);
|
||||
|
Loading…
Reference in New Issue
Block a user