-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpolicies.js
More file actions
25 lines (22 loc) · 667 Bytes
/
policies.js
File metadata and controls
25 lines (22 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Policy Mappings
* (sails.config.policies)
*
* Policies are simple functions which run **before** your actions.
*
* For more information on configuring policies, check out:
* https://sailsjs.com/docs/concepts/policies
*/
module.exports.policies = {
// Default to "allow" if not defined below.
'*': true,
// ALl the functions found in /controllers/admin/*
AdminController: {
'*': ['isLoggedIn', 'isAdmin']
},
// The functions in /controllers/common/*
CommonController: {
'*': 'isLoggedIn', // Default require the user is authenticated
'login': true, // Allow non-authenticated users access.
}
};