mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
dev: update app approved_for props visibility
Allows owner users to read the approved_for properties on their own apps
This commit is contained in:
parent
f5865daede
commit
4ce2dccc76
@ -181,6 +181,26 @@ class AppES extends BaseES {
|
||||
return expected_uid === await entity.get('uid')
|
||||
? origin : null ;
|
||||
})());
|
||||
|
||||
const is_owner = await (async () => {
|
||||
let owner = await entity.get('owner');
|
||||
|
||||
// TODO: why does this happen?
|
||||
if ( typeof owner === 'number' ) {
|
||||
owner = { id: owner };
|
||||
}
|
||||
|
||||
if ( ! owner ) return false;
|
||||
const actor = Context.get('actor');
|
||||
return actor.type.user.id === owner.id;
|
||||
})();
|
||||
|
||||
if ( ! is_owner ) {
|
||||
for ( let i=0;i<20;i++ ) console.log('TYHIS IS HAPPEN');
|
||||
entity.del('approved_for_listing');
|
||||
entity.del('approved_for_opening_items');
|
||||
entity.del('approved_for_incentive_program');
|
||||
}
|
||||
},
|
||||
async maybe_insert_subdomain_ (entity) {
|
||||
// Create and update is a situation where we might create a subdomain
|
||||
|
@ -128,15 +128,15 @@ module.exports = {
|
||||
},
|
||||
approved_for_listing: {
|
||||
type: 'flag',
|
||||
protected: true,
|
||||
read_only: true,
|
||||
},
|
||||
approved_for_opening_items: {
|
||||
type: 'flag',
|
||||
protected: true,
|
||||
read_only: true,
|
||||
},
|
||||
approved_for_incentive_program: {
|
||||
type: 'flag',
|
||||
protected: true,
|
||||
read_only: true,
|
||||
},
|
||||
|
||||
// SYSTEM
|
||||
|
Loading…
Reference in New Issue
Block a user