Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Implements JsonSerializable() : warning this is PHP5.4 ONLY!
Browse files Browse the repository at this point in the history
Fix setDeny()
  • Loading branch information
cdujeu committed Sep 18, 2015
1 parent 11e5a01 commit d28dcfa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/src/core/classes/class.AJXP_Permission.php
Expand Up @@ -22,7 +22,7 @@
defined('AJXP_EXEC') or die('Access not allowed');


class AJXP_Permission
class AJXP_Permission implements JsonSerializable
{
/**
* Use an integer number to store permission
Expand Down Expand Up @@ -110,7 +110,7 @@ function setWrite($value = true){
}
function setDeny($value = true){
if($value)
$this->value = $this->value & self::DENY;
$this->value = self::DENY;
else{
$this->value = $this->value & (self::DENY ^ self::MASK);
}
Expand Down Expand Up @@ -144,4 +144,16 @@ function __toString(){
return "READ WRITE";
}
}

/**
* Specify data which should be serialized to JSON
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/
function jsonSerialize()
{
return array("read" => $this->canRead(), "write" => $this->canWrite(), "deny" => $this->denies());
}
}
1 change: 1 addition & 0 deletions core/src/plugins/gui.ajax/res/js/vendor/nodejs/export.js
@@ -1,6 +1,7 @@
window.React = require('react');
window.PureRenderMixin = require('react/addons').addons.PureRenderMixin;
window.ReactCSSTransitionGroup = require('react/addons').addons.CSSTransitionGroup;
window.ReactUpdate = require('react/addons').addons.update;
window.ReactMUI = require('material-ui');
window.Infinite = require('react-infinite');
window.injectTapEventPlugin = require("react-tap-event-plugin");
Expand Down

0 comments on commit d28dcfa

Please sign in to comment.