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
c757f60d
Commit
c757f60d
authored
Dec 13, 2019
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blocked-role-added
parent
f6b48406
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
app.seeding.ts
server/app.seeding.ts
+5
-0
users.ts
server/methods/users.ts
+2
-2
No files found.
server/app.seeding.ts
View file @
c757f60d
...
...
@@ -25,6 +25,11 @@ export const seedDB = async () => {
Permissions
:
[
PERMISSIONS
.
CAN_LOGIN
,
PERMISSIONS
.
CAN_UPDATE_OWN_USER
],
Description
:
''
,
}).
toPromise
(),
Roles
.
insert
({
Title
:
'Blocked'
,
Permissions
:
[],
Description
:
''
,
}),
]);
}
else
{
// Update Roles Permissions
...
...
server/methods/users.ts
View file @
c757f60d
...
...
@@ -15,7 +15,7 @@ Meteor.methods({
},
registerUser
(
user
:
any
):
string
{
const
my
Role
=
Roles
.
findOne
({
Title
:
user
.
role
});
const
default
Role
=
Roles
.
findOne
({
Title
:
user
.
role
});
if
(
!
Accounts
.
findUserByEmail
(
user
.
email
))
{
const
userObj
=
{
...
...
@@ -24,7 +24,7 @@ Meteor.methods({
username
:
user
.
username
,
profile
:
{
Name
:
user
.
name
,
Role
:
my
Role
.
_id
,
Role
:
default
Role
.
_id
,
},
};
return
Accounts
.
createUser
(
userObj
);
...
...
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