controllers/PermissionController.js
Function exports
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(async, _, Controller, PermissionService) {
var AccountController = null;
var PermissionController = Controller.extend(
{
Function requiresPermission
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
requiresPermission: function(requiredPermissions) {
if (requiredPermissions instanceof Array) {
requiredPermissions = {
all: requiredPermissions
}
Function userRoleHasPermission
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function userRoleHasPermission(permissions, callback) {
var hasPermission = true;
if (!!permissions.length && !req.isAuthenticated()) {
return callback('User is not authenticated!');