mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
nodejs: user role
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
- nodejs: user role
|
||||||
|
|
||||||
## 1.12.0
|
## 1.12.0
|
||||||
- nodejs: refresh config
|
- nodejs: refresh config
|
||||||
- nodejs: support pages, numbers, key formats
|
- nodejs: support pages, numbers, key formats
|
||||||
|
|||||||
@ -1124,6 +1124,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
|||||||
const { reviewGroups } = user;
|
const { reviewGroups } = user;
|
||||||
const { commentGroups } = user;
|
const { commentGroups } = user;
|
||||||
const { userInfoGroups } = user;
|
const { userInfoGroups } = user;
|
||||||
|
const userRoles = user.roles;
|
||||||
|
|
||||||
const usersInfo = [];
|
const usersInfo = [];
|
||||||
const usersForProtect = [];
|
const usersForProtect = [];
|
||||||
@ -1211,6 +1212,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
|||||||
userImage: user.avatar ? `${req.DocManager.getServerUrl()}/images/${user.id}.png` : null,
|
userImage: user.avatar ? `${req.DocManager.getServerUrl()}/images/${user.id}.png` : null,
|
||||||
name,
|
name,
|
||||||
userGroup,
|
userGroup,
|
||||||
|
userRoles,
|
||||||
reviewGroups: JSON.stringify(reviewGroups),
|
reviewGroups: JSON.stringify(reviewGroups),
|
||||||
commentGroups: JSON.stringify(commentGroups),
|
commentGroups: JSON.stringify(commentGroups),
|
||||||
userInfoGroups: JSON.stringify(userInfoGroups),
|
userInfoGroups: JSON.stringify(userInfoGroups),
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class User {
|
|||||||
goback,
|
goback,
|
||||||
close,
|
close,
|
||||||
canSubmitForm,
|
canSubmitForm,
|
||||||
|
roles,
|
||||||
) {
|
) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -49,6 +50,7 @@ class User {
|
|||||||
this.goback = goback;
|
this.goback = goback;
|
||||||
this.close = close;
|
this.close = close;
|
||||||
this.canSubmitForm = canSubmitForm;
|
this.canSubmitForm = canSubmitForm;
|
||||||
|
this.roles = roles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,6 +64,7 @@ const descrUser1 = [
|
|||||||
'Can see the information about all users',
|
'Can see the information about all users',
|
||||||
'Can submit forms',
|
'Can submit forms',
|
||||||
'Has an avatar',
|
'Has an avatar',
|
||||||
|
'Has no roles',
|
||||||
];
|
];
|
||||||
|
|
||||||
const descrUser2 = [
|
const descrUser2 = [
|
||||||
@ -73,6 +76,7 @@ const descrUser2 = [
|
|||||||
'Can see the information about users from Group2 and users who don’t belong to any group',
|
'Can see the information about users from Group2 and users who don’t belong to any group',
|
||||||
'Can submit forms',
|
'Can submit forms',
|
||||||
'Has an avatar',
|
'Has an avatar',
|
||||||
|
'Has role "Anyone"',
|
||||||
];
|
];
|
||||||
|
|
||||||
const descrUser3 = [
|
const descrUser3 = [
|
||||||
@ -88,6 +92,7 @@ const descrUser3 = [
|
|||||||
'Can’t submit forms',
|
'Can’t submit forms',
|
||||||
'Can’t close history',
|
'Can’t close history',
|
||||||
'Can’t restore the file version',
|
'Can’t restore the file version',
|
||||||
|
'Has role "role"',
|
||||||
];
|
];
|
||||||
|
|
||||||
const descrUser0 = [
|
const descrUser0 = [
|
||||||
@ -105,6 +110,7 @@ const descrUser0 = [
|
|||||||
'View file without collaboration',
|
'View file without collaboration',
|
||||||
'Can’t submit forms',
|
'Can’t submit forms',
|
||||||
'Can’t refresh outdated file',
|
'Can’t refresh outdated file',
|
||||||
|
'Has empty role',
|
||||||
];
|
];
|
||||||
|
|
||||||
const users = [
|
const users = [
|
||||||
@ -124,6 +130,7 @@ const users = [
|
|||||||
{ blank: false },
|
{ blank: false },
|
||||||
{ visible: false },
|
{ visible: false },
|
||||||
true,
|
true,
|
||||||
|
null,
|
||||||
),
|
),
|
||||||
new User(
|
new User(
|
||||||
'uid-2',
|
'uid-2',
|
||||||
@ -145,6 +152,7 @@ const users = [
|
|||||||
{ text: 'Go to Documents' },
|
{ text: 'Go to Documents' },
|
||||||
{},
|
{},
|
||||||
true,
|
true,
|
||||||
|
[ 'Anyone' ],
|
||||||
),
|
),
|
||||||
new User(
|
new User(
|
||||||
'uid-3',
|
'uid-3',
|
||||||
@ -166,8 +174,9 @@ const users = [
|
|||||||
null,
|
null,
|
||||||
{},
|
{},
|
||||||
false,
|
false,
|
||||||
|
[ 'role' ],
|
||||||
),
|
),
|
||||||
new User('uid-0', null, null, null, null, {}, [], null, ['protect'], descrUser0, false, false, null, null, false),
|
new User('uid-0', null, null, null, null, {}, [], null, ['protect'], descrUser0, false, false, null, null, false, []),
|
||||||
];
|
];
|
||||||
|
|
||||||
// get a list of all the users
|
// get a list of all the users
|
||||||
|
|||||||
@ -60,7 +60,8 @@
|
|||||||
"group": "<%- editor.userGroup %>",
|
"group": "<%- editor.userGroup %>",
|
||||||
"id": "<%- editor.userid %>",
|
"id": "<%- editor.userid %>",
|
||||||
"image": "<%- editor.userImage %>",
|
"image": "<%- editor.userImage %>",
|
||||||
"name": "<%- editor.name %>"
|
"name": "<%- editor.name %>",
|
||||||
|
"roles": <%- JSON.stringify(editor.userRoles) %>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"height": "100%",
|
"height": "100%",
|
||||||
|
|||||||
Reference in New Issue
Block a user