-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVoterInterface.js.html
109 lines (82 loc) · 3.23 KB
/
VoterInterface.js.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>VoterInterface.js - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="VotersStack.html">VotersStack</a><ul class='methods'><li data-type='method'><a href="VotersStack.html#isAllowed">isAllowed</a></li><li data-type='method'><a href="VotersStack.html#registerVoter">registerVoter</a></li><li data-type='method'><a href="VotersStack.html#unregisterVoter">unregisterVoter</a></li></ul></li></ul><h3>Interfaces</h3><ul><li><a href="VoterInterface.html">VoterInterface</a><ul class='methods'><li data-type='method'><a href="VoterInterface.html#supportsPermission">supportsPermission</a></li><li data-type='method'><a href="VoterInterface.html#supportsResource">supportsResource</a></li><li data-type='method'><a href="VoterInterface.html#vote">vote</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">VoterInterface.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>var Interface = require('./Interface');
/**
* Desctibes interface for voter.
* Voter object implement 3 methods:
*
* @interface VoterInterface
*
* @type {Interface|exports|module.exports}
*/
var VoterInterface = new Interface('VoterInterface', ['vote', 'supportsResource', 'supportsPermission']);
/**
* Decide if User has Permission to perform action on Resource.
*
* @function
* @name VoterInterface#vote
* @param {*} user
* @param {*} resource
* @param {*} permission
* @param {VoterInterface~votingCallback} cb
*/
/**
* Check if voter supports resource.
*
* @function
* @name VoterInterface#supportsResource
* @param {*} resource
* @return {boolean} resource support state
*/
/**
* Check if voter supports permission.
*
* @function
* @name VoterInterface#supportsPermission
* @param {*} permission
* @return {boolean} permission support state
*/
/**
* Callback called after vote by single voter.
*
* @callback VoterInterface~votingCallback
* @param {null|object} error
* @param {DECISION} voting decision.
*/
exports = module.exports = VoterInterface;</code></pre>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Thu Nov 19 2015 20:44:58 GMT+0100 (CET) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>