add "repository" permissions role and make sure we have a sane "accept" default for the custom role.

This commit is contained in:
friendica 2014-10-27 16:19:30 -07:00
parent bc3e7c4cad
commit 583b445bc0
3 changed files with 63 additions and 5 deletions

View File

@ -47,13 +47,22 @@ Similiar to Social - Mostly Public, but tailored for RSS feed sources. Items may
Not listed in directory. Online presence is meaningless, therefore hidden. Feed is published only to members of the 'Friends' collection. New connections are automatically added to this collections. Members must be manually approved by the channel owner. Not listed in directory. Online presence is meaningless, therefore hidden. Feed is published only to members of the 'Friends' collection. New connections are automatically added to this collections. Members must be manually approved by the channel owner.
##Soapbox ##Special
**Celebrity/Soapbox**
Listed in directory. Communications are by default public. Online presence is hidden. No commenting or feedback of any form is allowed, though connections have the ability to "like" your profile. Listed in directory. Communications are by default public. Online presence is hidden. No commenting or feedback of any form is allowed, though connections have the ability to "like" your profile.
##Custom/Advanced
You decide the privacy behaviour. **Group Repository**
A public forum which allows members to post files/photos/webpages.
##Custom/Expert Mode
Set all the privacy and permissions manually to suit your specific needs.

View File

@ -460,6 +460,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -492,6 +493,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -524,6 +526,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_SPECIFIC; $ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -555,6 +558,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -586,6 +590,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -618,6 +623,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_SPECIFIC; $ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_CONTACTS; $ret['channel_r_storage'] = PERMS_CONTACTS;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_CONTACTS; $ret['channel_r_pages'] = PERMS_CONTACTS;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -649,6 +655,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_NETWORK; $ret['channel_a_republish'] = PERMS_NETWORK;
@ -681,6 +688,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = PERMS_CONTACTS; $ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -710,6 +718,7 @@ function get_role_perms($role) {
$ret['channel_w_chat'] = 0; $ret['channel_w_chat'] = 0;
$ret['channel_a_delegate'] = 0; $ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC; $ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = 0;
$ret['channel_r_pages'] = PERMS_PUBLIC; $ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = 0; $ret['channel_w_pages'] = 0;
$ret['channel_a_republish'] = PERMS_SPECIFIC; $ret['channel_a_republish'] = PERMS_SPECIFIC;
@ -717,6 +726,40 @@ function get_role_perms($role) {
break; break;
case 'repository':
$ret['perms_auto'] = true;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_W_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_W_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_CONTACTS;
$ret['channel_w_wall'] = PERMS_CONTACTS;
$ret['channel_w_tagwall'] = PERMS_CONTACTS;
$ret['channel_w_comment'] = PERMS_CONTACTS;
$ret['channel_w_mail'] = PERMS_CONTACTS;
$ret['channel_w_photos'] = PERMS_CONTACTS;
$ret['channel_w_chat'] = PERMS_CONTACTS;
$ret['channel_a_delegate'] = 0;
$ret['channel_r_storage'] = PERMS_PUBLIC;
$ret['channel_w_storage'] = PERMS_CONTACTS;
$ret['channel_r_pages'] = PERMS_PUBLIC;
$ret['channel_w_pages'] = PERMS_CONTACTS;
$ret['channel_a_republish'] = PERMS_SPECIFIC;
$ret['channel_w_like'] = PERMS_NETWORK;
break;
default: default:
break; break;
@ -745,8 +788,8 @@ function role_selector($current) {
array('forum' => t('Mostly Public'), 'forum_restricted' => t('Restricted'), 'forum_private' => t('Private'))), array('forum' => t('Mostly Public'), 'forum_restricted' => t('Restricted'), 'forum_private' => t('Private'))),
'feed' => array( t('Feed Republish'), 'feed' => array( t('Feed Republish'),
array('feed' => t('Mostly Public'), 'feed_restricted' => t('Restricted'))), array('feed' => t('Mostly Public'), 'feed_restricted' => t('Restricted'))),
'soapbox' => array( t('Celebrity/Soapbox'), 'special' => array( t('Special Purpose'),
array('soapbox' => t('Mostly Public'))), array('soapbox' => t('Celebrity/Soapbox'), 'repository' => t('Group Repository'))),
'other' => array( t('Other'), 'other' => array( t('Other'),
array('custom' => t('Custom/Expert Mode')))); array('custom' => t('Custom/Expert Mode'))));
$o = '<select name="permissions_role" id="privacy-role-select">'; $o = '<select name="permissions_role" id="privacy-role-select">';

View File

@ -261,6 +261,12 @@ function connedit_content(&$a) {
$x = get_role_perms($role); $x = get_role_perms($role);
if($x['perms_accept']) if($x['perms_accept'])
$my_perms = $x['perms_accept']; $my_perms = $x['perms_accept'];
else {
// fixme - we need to be able to define these somewhere for the custom role
$my_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
}
} }
if($my_perms) { if($my_perms) {
$o .= "<script>function connectDefaultShare() { $o .= "<script>function connectDefaultShare() {