aboutsummaryrefslogtreecommitdiffstats
path: root/include/AccessList.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-03 18:12:02 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-03 18:12:02 +0200
commitadfc748bfa724ad8cc9d4ebf6f9d095fc56fb936 (patch)
tree2d5e256b6bb001397939debad609789367745fc9 /include/AccessList.php
parent2ce1e3678acd59409f1013433db99df6624c2895 (diff)
parentf3cb17ac3b007afd2dc5bf7cdad8a054b4d7fcd8 (diff)
downloadvolse-hubzilla-adfc748bfa724ad8cc9d4ebf6f9d095fc56fb936.tar.gz
volse-hubzilla-adfc748bfa724ad8cc9d4ebf6f9d095fc56fb936.tar.bz2
volse-hubzilla-adfc748bfa724ad8cc9d4ebf6f9d095fc56fb936.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/AccessList.php')
-rw-r--r--include/AccessList.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/AccessList.php b/include/AccessList.php
index 46e66d33d..43f1de111 100644
--- a/include/AccessList.php
+++ b/include/AccessList.php
@@ -34,6 +34,11 @@ class AccessList {
return $this->explicit;
}
+ /**
+ * Set AccessList from strings such as those in already
+ * existing stored data items
+ */
+
function set($arr,$explicit = true) {
$this->allow_cid = $arr['allow_cid'];
$this->allow_gid = $arr['allow_gid'];
@@ -43,6 +48,12 @@ class AccessList {
$this->explicit = $explicit;
}
+ /**
+ * return an array consisting of the current
+ * access list components where the elements
+ * are directly storable.
+ */
+
function get() {
return array(
'allow_cid' => $this->allow_cid,
@@ -52,6 +63,12 @@ class AccessList {
);
}
+ /**
+ * Set AccessList from arrays, such as those provided by
+ * acl_selector(). For convenience, a string (or non-array) input is
+ * assumed to be a comma-separated list and auto-converted into an array.
+ */
+
function set_from_array($arr,$explicit = true) {
$this->allow_cid = perms2str((is_array($arr['contact_allow']))
? $arr['contact_allow'] : explode(',',$arr['contact_allow']));