Completed
Pull Request — master (#40)
by
unknown
01:51
created

src/cli/cms/templates/handlebars/isAuthorized.js   A

Complexity

Total Complexity 2
Complexity/F 2

Size

Lines of Code 15
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
wmc 2
nc 1
mnd 1
bc 3
fnc 1
dl 0
loc 15
rs 10
bpm 3
cpm 2
noi 1
c 1
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A isAuthorized.js ➔ isAuthorized 0 7 2
1
import {
2
  config,
0 ignored issues
show
Unused Code introduced by
The variable config seems to be never used. Consider removing it.
Loading history...
3
	User
4
} from '../../../'
5
6
/**
7
 * Handlebars helper, to print className and escape it string
8
 */
9
export default function isAuthorized(route, role, ctx) {
10
  if (User.utils.isUserAllowedOnRoute(role, route)) {
11
    return ctx.fn(this)
12
  }else {
13
    return ctx.inverse(this)
14
  }
15
}
16