Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
angular-meteor
api
Commits
cd671864
Commit
cd671864
authored
Dec 26, 2019
by
Ali Arshad
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'user-registration' into 'master'
Users Listing See merge request jibc/jibc-meteor-api!4
parents
62f4082d
7431838a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
config.ts
server/config.ts
+2
-0
users.method.ts
server/methods/users.method.ts
+8
-0
migrations.ts
server/migrations.ts
+12
-3
email.service.ts
server/services/email.service.ts
+0
-1
No files found.
server/config.ts
View file @
cd671864
...
@@ -9,6 +9,8 @@ export const PERMISSIONS = {
...
@@ -9,6 +9,8 @@ export const PERMISSIONS = {
CAN_ACCESS_SETTINGS
:
'CAN_ACCESS_SETTINGS'
,
CAN_ACCESS_SETTINGS
:
'CAN_ACCESS_SETTINGS'
,
CAN_ACCESS_EMAIL_TEMPLATES
:
'CAN_ACCESS_EMAIL_TEMPLATES'
,
CAN_ACCESS_EMAIL_TEMPLATES
:
'CAN_ACCESS_EMAIL_TEMPLATES'
,
CAN_UPDATE_ALL_USERS
:
'CAN_UPDATE_ALL_USERS'
,
CAN_UPDATE_ALL_USERS
:
'CAN_UPDATE_ALL_USERS'
,
CAN_ACCESS_USERS_PAGE
:
'CAN_ACCESS_USERS_PAGE'
,
CAN_ACCESS_PROFILE
:
'CAN_ACCESS_PROFILE'
,
};
};
export
const
CONFIG
=
{
export
const
CONFIG
=
{
...
...
server/methods/users.method.ts
View file @
cd671864
...
@@ -3,9 +3,17 @@ import { rolesCollection } from '../collections/role.collection';
...
@@ -3,9 +3,17 @@ import { rolesCollection } from '../collections/role.collection';
import
{
ERR
,
E_CODE
,
PERMISSIONS
}
from
'../config'
;
import
{
ERR
,
E_CODE
,
PERMISSIONS
}
from
'../config'
;
import
{
UtilsService
}
from
'../services/utils.service'
;
import
{
UtilsService
}
from
'../services/utils.service'
;
import
{
EmailService
}
from
'../services/email.service'
;
import
{
EmailService
}
from
'../services/email.service'
;
import
{
QueryModel
}
from
'../models/query.model'
;
Meteor
.
methods
({
Meteor
.
methods
({
usersGetCount
(
query
:
QueryModel
):
any
{
return
{
recordsFiltered
:
Meteor
.
users
.
find
(
query
.
query
).
count
(),
recordsTotal
:
Meteor
.
users
.
find
().
count
(),
};
},
registerUser
(
user
:
any
):
string
{
registerUser
(
user
:
any
):
string
{
const
defaultRole
=
rolesCollection
.
findOne
({
title
:
user
.
role
});
const
defaultRole
=
rolesCollection
.
findOne
({
title
:
user
.
role
});
...
...
server/migrations.ts
View file @
cd671864
...
@@ -19,7 +19,7 @@ Migrations.add({
...
@@ -19,7 +19,7 @@ Migrations.add({
rolesCollection
.
insert
({
rolesCollection
.
insert
({
title
:
'User'
,
title
:
'User'
,
permissions
:
[
PERMISSIONS
.
CAN_LOGIN
,
PERMISSIONS
.
CAN_UPDATE_OWN_USER
,
permissions
:
[
PERMISSIONS
.
CAN_LOGIN
,
PERMISSIONS
.
CAN_UPDATE_OWN_USER
,
PERMISSIONS
.
CAN_ACCESS_DASHBOARD_PAGE
],
PERMISSIONS
.
CAN_ACCESS_DASHBOARD_PAGE
,
PERMISSIONS
.
CAN_ACCESS_PROFILE
],
description
:
''
,
description
:
''
,
});
});
rolesCollection
.
insert
({
rolesCollection
.
insert
({
...
@@ -57,6 +57,15 @@ Migrations.add({
...
@@ -57,6 +57,15 @@ Migrations.add({
role
:
rolesCollection
.
findOne
({
title
:
'User'
}).
_id
,
role
:
rolesCollection
.
findOne
({
title
:
'User'
}).
_id
,
},
},
});
});
Accounts
.
createUser
({
username
:
'user'
,
password
:
'User1234'
,
email
:
'user@vqode.com'
,
profile
:
{
name
:
'User'
,
role
:
rolesCollection
.
findOne
({
title
:
'User'
}).
_id
,
},
});
}
}
},
},
});
});
...
@@ -70,7 +79,7 @@ Migrations.add({
...
@@ -70,7 +79,7 @@ Migrations.add({
settingsCollection
.
insert
({
settingsCollection
.
insert
({
Key
:
'REGISTER'
,
Key
:
'REGISTER'
,
Value
:
{
Value
:
{
SUBJECT
:
'Welcome to
$p
latform'
,
SUBJECT
:
'Welcome to
My P
latform'
,
CONTENT
:
'Hi $name! You are our $role now. Please click on the link <a href="$link" target="_blank">$link</a> to verify your account.'
,
CONTENT
:
'Hi $name! You are our $role now. Please click on the link <a href="$link" target="_blank">$link</a> to verify your account.'
,
},
},
Description
:
'Register Email Template'
,
Description
:
'Register Email Template'
,
...
@@ -82,7 +91,7 @@ Migrations.add({
...
@@ -82,7 +91,7 @@ Migrations.add({
settingsCollection
.
insert
({
settingsCollection
.
insert
({
Key
:
'RESET'
,
Key
:
'RESET'
,
Value
:
{
Value
:
{
SUBJECT
:
'Reset Password for
$p
latform'
,
SUBJECT
:
'Reset Password for
My P
latform'
,
CONTENT
:
'Hi $name! Don
\'
t worry. Reset your password by clicking on the following link <a href="$link" target="_blank">$link</a>.'
,
CONTENT
:
'Hi $name! Don
\'
t worry. Reset your password by clicking on the following link <a href="$link" target="_blank">$link</a>.'
,
},
},
Description
:
'Reset Password Email Template'
,
Description
:
'Reset Password Email Template'
,
...
...
server/services/email.service.ts
View file @
cd671864
...
@@ -70,7 +70,6 @@ export class EmailService {
...
@@ -70,7 +70,6 @@ export class EmailService {
static
formattedContent
(
content
:
string
,
name
:
string
,
role
:
string
,
email
,
link
=
null
):
string
{
static
formattedContent
(
content
:
string
,
name
:
string
,
role
:
string
,
email
,
link
=
null
):
string
{
const
str
=
content
.
replace
(
/
\$
name/g
,
name
)
const
str
=
content
.
replace
(
/
\$
name/g
,
name
)
.
replace
(
/
\$
role/g
,
role
)
.
replace
(
/
\$
role/g
,
role
)
.
replace
(
/
\$
platform/g
,
CONFIG
.
SiteName
)
.
replace
(
/
\$
email/g
,
email
);
.
replace
(
/
\$
email/g
,
email
);
return
link
?
str
.
replace
(
/
\$
link/g
,
link
)
:
str
;
return
link
?
str
.
replace
(
/
\$
link/g
,
link
)
:
str
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment