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
1ec9f69c
Commit
1ec9f69c
authored
Dec 26, 2019
by
GD-A-150752
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove-user-status-extra-method
parent
44a764a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
17 deletions
+1
-17
config.ts
server/config.ts
+1
-0
users.method.ts
server/methods/users.method.ts
+0
-17
No files found.
server/config.ts
View file @
1ec9f69c
...
...
@@ -10,6 +10,7 @@ export const PERMISSIONS = {
CAN_ACCESS_EMAIL_TEMPLATES
:
'CAN_ACCESS_EMAIL_TEMPLATES'
,
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
=
{
...
...
server/methods/users.method.ts
View file @
1ec9f69c
...
...
@@ -104,21 +104,4 @@ Meteor.methods({
return
Accounts
.
findUserByEmail
(
email
);
},
switchUser
(
user
:
Meteor
.
User
,
block
=
false
):
any
{
if
(
UtilsService
.
hasPermission
(
PERMISSIONS
.
CAN_UPDATE_USER
))
{
if
(
block
)
{
const
disableRole
=
rolesCollection
.
findOne
({
title
:
'Blocked'
});
user
.
profile
.
originalRole
=
user
.
profile
.
role
;
user
.
profile
.
role
=
disableRole
.
_id
;
}
else
{
user
.
profile
.
role
=
user
.
profile
.
originalRole
;
delete
user
.
profile
.
originalRole
;
}
return
Meteor
.
users
.
update
(
user
.
_id
,
user
);
}
throw
new
Meteor
.
Error
(
E_CODE
.
FORBIDDEN
,
ERR
.
FORBIDDEN
);
},
});
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