mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-27 08:21:03 +02:00
Server: Defaults to enabling share when creating user from admin UI
This commit is contained in:
parent
51051e0ee0
commit
e59e3aa7d1
@ -38,6 +38,12 @@ function makeUser(isNew: boolean, fields: any): User {
|
||||
return user;
|
||||
}
|
||||
|
||||
function defaultUser(): User {
|
||||
return {
|
||||
can_share: 1,
|
||||
};
|
||||
}
|
||||
|
||||
function userIsNew(path: SubPath): boolean {
|
||||
return path.id === 'new';
|
||||
}
|
||||
@ -72,6 +78,7 @@ router.get('users/:id', async (path: SubPath, ctx: AppContext, user: User = null
|
||||
const userId = userIsMe(path) ? owner.id : path.id;
|
||||
|
||||
user = !isNew ? user || await userModel.load(userId) : null;
|
||||
if (isNew && !user) user = defaultUser();
|
||||
|
||||
await userModel.checkIfAllowed(ctx.owner, AclAction.Read, user);
|
||||
|
||||
|
@ -60,8 +60,6 @@ let createdDbPath_: string = null;
|
||||
export async function beforeAllDb(unitName: string) {
|
||||
createdDbPath_ = `${packageRootDir}/db-test-${unitName}.sqlite`;
|
||||
|
||||
console.info('PPPPPPPPPPPP', createdDbPath_);
|
||||
|
||||
const tempDir = `${packageRootDir}/temp/test-${unitName}`;
|
||||
await fs.mkdirp(tempDir);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user