From ef97e5a0636c2563f696b8601619d963b363fe00 Mon Sep 17 00:00:00 2001 From: Treer Date: Tue, 10 May 2016 00:15:57 +1000 Subject: minor cleanup. No functional changes --- Zotlabs/Module/Settings.php | 2 +- doc/acl_dialog_post.html | 10 ++++------ include/PermissionDescription.php | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Zotlabs/Module/Settings.php b/Zotlabs/Module/Settings.php index 8674ca5e7..a6293e842 100644 --- a/Zotlabs/Module/Settings.php +++ b/Zotlabs/Module/Settings.php @@ -1066,7 +1066,7 @@ class Settings extends \Zotlabs\Web\Controller { '$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), intval($channel['channel_max_friend_req']) , t('May reduce spam activity')), '$permissions' => t('Default Post Permissions'), '$permdesc' => t("\x28click to open/close\x29"), - '$aclselect' => populate_acl($perm_defaults, false, \PermissionDescription::fromDescription(t('Use my default audience setting for the type of channel'))), + '$aclselect' => populate_acl($perm_defaults, false, \PermissionDescription::fromDescription(t('Use my default audience setting for the type of post'))), '$suggestme' => $suggestme, '$group_select' => $group_select, '$role' => array('permissions_role' , t('Channel permissions category:'), $permissions_role, '', get_roles()), diff --git a/doc/acl_dialog_post.html b/doc/acl_dialog_post.html index b387ec08e..80b2c68b6 100644 --- a/doc/acl_dialog_post.html +++ b/doc/acl_dialog_post.html @@ -3,13 +3,11 @@

Post Permissions

-

Sometimes called Access Control List, or ACL, the permissions set who is able to see your new post.

+

The permissions dialog lets you select which channels and/or privacy groups can see the post. You can also select who is explicitly denied access. For example, say you are planning a surprise party for a friend. You can send an invitation post to everyone in your Friends group except the friend you are surprising. In this case you "Show" the Friends group but "Don't show" that one person.

-

Pressing the ACL button ( or ) beside the Submit button will display a dialog in which you can select what channels and/or privacy groups can see the post. You can also select who is explicitly denied access. For example, say you are planning a surprise party for a friend. You can send an invitation post to everyone in your Friends group except the friend you are surprising. In this case you "Show" the Friends group but "Don't show" that one person.

- -
-
Tip:
-
The border color of each channel indicates whether that channel — or one of the groups it belongs to — has access to the post. The border color will also indicate when a channel [or group it belongs to] has been expliciyly set to "Don't show".
+
+
Tip! +
The border color of each channel indicates whether that channel — or one of the groups it's a member of — will have access to the post. The border color will also indicate when a channel, or group it belongs to, has been explicitly set to "Don't show".

Why can't I edit a post's permissions after I saved it?

diff --git a/include/PermissionDescription.php b/include/PermissionDescription.php index d5a3a972c..75dd9ecf7 100644 --- a/include/PermissionDescription.php +++ b/include/PermissionDescription.php @@ -32,10 +32,11 @@ class PermissionDescription { } /** - * If the interpretation of an empty ACL can't be summarised with a global default permission + * If the interpretation of an empty ACL can't be summarised with a global default permission * or a specific permission setting then use this method and describe what it means instead. + * Remember to localize the description first. * - * @param string $description - the caption for the no-ACL option in the ACL dialog. + * @param string $description - the localized caption for the no-ACL option in the ACL dialog. * @return a new instance of PermissionDescription */ public static function fromDescription($description) { @@ -44,8 +45,9 @@ class PermissionDescription { /** - * Use this method only if the interpretation of an empty ACL doesn't fall back to a global - * default permission. You should pass one of the constants from boot.php - PERMS_PUBLIC, PERMS_NETWORK etc. + * Use this method only if the interpretation of an empty ACL doesn't fall back to a global + * default permission. You should pass one of the constants from boot.php - PERMS_PUBLIC, + * PERMS_NETWORK etc. * * @param integer $perm - a single enumerated constant permission - PERMS_PUBLIC, PERMS_NETWORK etc. * @return a new instance of PermissionDescription @@ -81,6 +83,15 @@ class PermissionDescription { if (array_key_exists($permname, $global_perms)) { $permDetails = $global_perms[$permname]; + + // It should be OK to always just read the permissions from App::$channel + // + // App::$profile is a union of channel and profile fields. + // The distinction is basically that App::$profile is pointing to the resource + // being observed. App::$channel is referring to the current logged-in channel + // member (if this is a local channel) e.g. the observer. We only show the ACL + // widget to the page owner (observer and observed are the same) so in that case + // I believe either may be safely used here. $channelPerm = \App::$channel[$permDetails[0]]; $result = new PermissionDescription($permDetails[1], $channelPerm); } else { -- cgit v1.2.3