@websanova/vue-auth
Advanced tools
Comparing version 2.21.13-beta to 2.21.14-beta
{ | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.21.13-beta" | ||
"@websanova/vue-auth": "2.21.14-beta" | ||
}, | ||
@@ -5,0 +5,0 @@ |
{ | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.21.13-beta", | ||
"@websanova/vue-auth": "2.21.14-beta", | ||
"axios": "0.16.2", | ||
@@ -5,0 +5,0 @@ "vue-axios": "2.0.2" |
{ | ||
"dependencies": { | ||
"nuxt": "1.0.0-rc3", | ||
"@websanova/vue-auth": "2.21.13-beta", | ||
"@websanova/vue-auth": "2.21.14-beta", | ||
"vue-resource": "1.3.4", | ||
@@ -6,0 +6,0 @@ "axios": "0.16.2", |
@@ -47,3 +47,3 @@ { | ||
"dependencies": { | ||
"@websanova/vue-auth": "2.21.13-beta", | ||
"@websanova/vue-auth": "2.21.14-beta", | ||
"axios": "^0.16.2", | ||
@@ -50,0 +50,0 @@ "compression": "^1.6.2", |
@@ -5,2 +5,3 @@ # Change Log | ||
* Add optional key prameter for `$auth.check(data, key)`. | ||
* Add localhost check for cookies (IE Fix). | ||
@@ -7,0 +8,0 @@ * Add frisbee driver. |
@@ -64,2 +64,3 @@ # Methods | ||
* It also accepts arguments to check for a specific role or set of roles. | ||
* Accepts optional `key` parameter to use instead of the default `rolesVar`. | ||
@@ -69,2 +70,3 @@ ```html | ||
<a v-if="$auth.check('admin')">admin</a> | ||
<a v-if="$auth.check('reports-post', 'perms')">reports</a> | ||
<a v-if="$auth.check(['admin', 'manager'])">manage</a> | ||
@@ -71,0 +73,0 @@ <a v-if="$auth.check()" v-on:click="$auth.logout()">logout</a> |
@@ -17,3 +17,3 @@ { | ||
"version": "2.21.13-beta", | ||
"version": "2.21.14-beta", | ||
@@ -20,0 +20,0 @@ "repository": { |
@@ -165,6 +165,6 @@ var __utils = require('./lib/utils.js'), | ||
function _check(role) { | ||
function _check(role, key) { | ||
if (this.watch.authenticated === true) { | ||
if (role) { | ||
return __utils.compare(role, this.watch.data[this.options.rolesVar]); | ||
return __utils.compare(role, this.watch.data[key || this.options.rolesVar]); | ||
} | ||
@@ -646,4 +646,4 @@ | ||
Auth.prototype.check = function (role) { | ||
return this.options.check.call(this, role); | ||
Auth.prototype.check = function (role, key) { | ||
return this.options.check.call(this, role, key); | ||
}; | ||
@@ -650,0 +650,0 @@ |
769209
144