Chore refactor permissions export
Just exporting the entity permissions itself
TO QA
On the review sites, the permissions flag is already on, but we'll need to make sure the permissions feature flag is set on staging. @edgebal and @benhayward.ben were working on a cookie mechanism.
When you load up https://chore-refactor-permissions-export.minds.io/newsfeed/subscriptions
Look at the responses for loading a feed
The requests should be coming back with a permissions object on the entities, that has a role and a series of flags
This is the properly-formed request coming out of a v1/newsfeed/single/{guid} endpoint
https://chore-refactor-permissions-export.minds.io/api/v1/newsfeed/single/1023986589589573649?
{
"status": "success",
"activity": {
"guid": "1023986589589573649",
"type": "activity",
"time_created": "1569513427",
"time_updated": "1569513427",
"container_guid": "997650977647497234",
"owner_guid": "997650977647497234",
"access_id": "2",
"tags": [
],
"nsfw": [
],
"nsfw_lock": [
],
"allow_comments": true,
"title": false,
"blurb": false,
"perma_url": false,
"message": "Say Emi",
"ownerObj": {
"guid": "997650977647497234",
"type": "user",
"subtype": false,
"time_created": "1563234528",
"time_updated": false,
"container_guid": "0",
"owner_guid": "0",
"site_guid": false,
"access_id": "2",
"tags": [
],
"nsfw": [
],
"nsfw_lock": [
],
"allow_comments": false,
"name": "Brian Hatchet !!!",
"username": "brianhatchet2",
"language": "en",
"icontime": "1567556483",
"legacy_guid": false,
"featured_id": false,
"banned": "no",
"ban_reason": false,
"website": "",
"briefdescription": "dsada",
"dob": "",
"gender": "",
"city": "saddasads",
"merchant": false,
"boostProPlus": false,
"fb": false,
"mature": 0,
"monetized": "",
"signup_method": false,
"social_profiles": [
],
"feature_flags": false,
"programs": [
],
"plus": true,
"hashtags": false,
"verified": false,
"founder": false,
"disabled_boost": false,
"boost_autorotate": true,
"categories": [
],
"wire_rewards": null,
"pinned_posts": [
],
"is_mature": false,
"mature_lock": false,
"last_accepted_tos": 1,
"opted_in_hashtags": 1,
"last_avatar_upload": "1566410594",
"canary": false,
"theme": "dark",
"toaster_notifications": true,
"mode": 1,
"btc_address": "",
"chat": true,
"urn": "urn:user:997650977647497234",
"subscribed": false,
"subscriber": false,
"boost_rating": 1,
"pro": false,
"rewards": false,
"p2p_media_enabled": false,
"is_admin": false,
"onchain_booster": 0,
"eth_wallet": "",
"rating": 1
},
"containerObj": false,
"thumbnail_src": false,
"remind_object": false,
"entity_guid": false,
"featured": false,
"featured_guid": false,
"custom_type": false,
"custom_data": false,
"thumbs:up:count": 0,
"thumbs:up:user_guids": [
],
"thumbs:down:count": 0,
"thumbs:down:user_guids": false,
"p2p_boosted": false,
"mature": false,
"monetized": false,
"paywall": "",
"edited": "",
"comments_enabled": true,
"wire_totals": {
"tokens": "0"
},
"boost_rejection_reason": -1,
"pending": "",
"rating": 2,
"ephemeral": false,
"hide_impressions": false,
"pinned": false,
"comments:count": 1,
"urn": "urn:activity:1023986589589573649",
"impressions": 25,
"reminds": 0,
"wire_threshold": null,
"time_sent": null,
"thumbnails": [
],
"permissions": {
"name": "entity_owner",
"permissions": [
"edit_post",
"delete_post",
"view",
"create_comment",
"edit_comment",
"delete_comment",
"vote",
"remind",
"wire"
]
}
}
}
changed milestone to %Permission #review
added Sprint::09/25 - Oldfashioned Owl Squad::Green scoped labels
changed target branch from
master
toepic/permissions-28
approved this merge request
changed the description 2 times within 2 minutes
added 1 commit
- fd0e5557 - (feat): channel owner should be able to create new groups
added 6 commits
- e3689bc7...c9daabe0 - 5 commits from branch
epic/permissions-28
- 12231b32 - Merge branch 'epic/permissions-28' into chore-refactor-permissions-export
- e3689bc7...c9daabe0 - 5 commits from branch
changed the description
approved this merge request
230 ]); 231 $entities[$k]['permissions'] = $permissions->export(); 232 } 233 $entities[$k]['guid'] = (string) $entities[$k]['guid']; //javascript doesn't like long numbers.. 234 if (isset($entities[$k]['ownerObj']['guid'])) { 235 $entities[$k]['ownerObj']['guid'] = (string) $entity->ownerObj['guid']; 236 } 237 foreach ($exceptions as $exception) { 238 $entities[$k][$exception] = $entity->$exception; 239 } 229 $export = $entity->export(); 230 //Calculate new permissions object with the entities 231 if ($includePermissions && $entity && Di::_()->get('Features\Manager')->has('permissions')) { 232 /** @var Manager $permissionsManager */ 233 $permissionsManager = Di::_()->get('Permissions\Manager'); 234 $permissions = $permissionsManager->getList([ - Owner
Is this doing a database call on every entity export?
21 21 * @property-read string $enabled 22 22 */ 23 23 abstract class ElggEntity extends ElggData implements 24 Importable // Allow import of data 24 Importable // Allow import of data - Owner
tab?
21 21 * @property-read string $enabled 22 22 */ 23 23 abstract class ElggEntity extends ElggData implements 24 Importable // Allow import of data 24 Importable // Allow import of data - Owner
This file needs fixing. Looks like its been resorted to tabs.
added MR::Requires Changes scoped label
- Owner
Composer.phar also need removing