authenticationController
Summary
Defines a controller to handlerequests relative to back end authentication.
Constructor
authenticationController
Syntax
authenticationController
()
Summary
Item Index
Methods
Methods
authenticateExternalAction
Syntax
authenticateExternalAction
-
request
-
response
-
next
Summary
Handles user authentication using external providers (which require a redirection on third party site).
authenticateInternalAction
Syntax
authenticateInternalAction
-
request
-
response
-
next
Summary
Handles user authentication using internal providers (which do not require a redirection to a third party site).
getPermissionByUrl
Syntax
Summary
Retrieves, recursively, the permission corresponding to the couple url / http method.
Parameters:
Returns:
The permission id if found, null otherwise
Example:
var permissions = [
{
label: 'Permissions group',
permissions: [
{
id: 'perm-1',
name: 'Name of the permission',
description: 'Description of the permission',
paths: [ 'get /publishVideo' ]
}
]
}
];
getPermissionByUrl(permissions, '/publishVideo', 'GET'); // "perm-1"
getPermissionByUrl(permissions, '/video', 'GET'); // null
getPermissionsAction
Syntax
getPermissionsAction
-
request
-
response
-
next
Summary
Gets the tree of groups / permissions and return it as a JSON object.
isUserProfileUrl
Syntax
Summary
Checks if asked page is the user profile.
All users must have access to its profile.
Parameters:
Returns:
true if the page is the user profile page, false otherwise
logoutAction
Syntax
logoutAction
-
request
-
response
-
next
Summary
Logs out user.
An HTTP code 200 is returned to the client with no content.
restrictAction
Syntax
restrictAction
-
request
-
response
-
next
Summary
Checks if current request is authenticated.
If not send back an HTTP code 401 with appropriate page. It just get to the next route action if permission is granted.