Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
832
Issues
832
List
Boards
Labels
Service Desk
Milestones
Merge Requests
52
Merge Requests
52
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
41f27df2
Commit
41f27df2
authored
34 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): do not allow banned page to be show to banned users
parent
b6bb91bc
epic/ReportingAndModeration
No related merge requests found
Pipeline
#61880180
failed with stage
in 7 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
banned.service.ts
src/app/modules/report/banned/banned.service.ts
+6
-0
No files found.
src/app/modules/report/banned/banned.service.ts
View file @
41f27df2
...
...
@@ -8,10 +8,16 @@ export class BannedService {
constructor
(
private
router
:
Router
,
private
session
:
Session
)
{
this
.
router
.
events
.
subscribe
((
navigationState
)
=>
{
if
(
navigationState
instanceof
NavigationStart
)
{
// Forward to moderation banned page if banned
if
(
this
.
session
.
getLoggedInUser
().
banned
===
'yes'
&&
navigationState
.
url
!=
'/moderation/banned'
)
{
this
.
router
.
navigate
([
'/moderation/banned'
]);
}
// Do not allow access to banned page if not banned
if
(
this
.
session
.
getLoggedInUser
().
banned
!==
'yes'
&&
navigationState
.
url
===
'/moderation/banned'
)
{
this
.
router
.
navigate
([
'/newsfeed'
]);
}
}
});
}
...
...
This diff is collapsed.
Click to expand it.
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