Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Backend - Engine
Minds Backend - Engine
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 232
    • Issues 232
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 36
    • Merge Requests 36
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Packages
    • Packages
    • List
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds Backend - EngineMinds Backend - Engine
  • Merge Requests
  • !349

Open
Opened 16 hours ago by Brian Hatchet@brianhatchet:speech_balloon:
  • Report abuse
Report abuse

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

https://chore-refactor-permissions-export.minds.io/api/v2/feeds/subscribed/activities?sync=1&limit=150&as_activities=0&from_timestamp=

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"
      ]
    }
  }
}


Edited 9 hours ago by Brian Hatchet

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b "chore-refactor-permissions-export" "origin/chore-refactor-permissions-export"

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/epic/permissions-28"
git merge --no-ff "chore-refactor-permissions-export"

Step 4. Push the result of the merge to GitLab

git push origin "epic/permissions-28"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

Request to merge chore-refactor-permissions-export into epic/permissions-28
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #86151529 passed for 2b856941 on chore-refactor-permissions-export
          Requires approval from QA. Approved by
          Emiliano Balbuena
          Emiliano Balbuena
          Mark Harding
          Mark Harding
          Marcelo Rivera
          Marcelo Rivera
          Olivia Madrid
          Olivia Madrid
          Ben Hayward
          Ben Hayward
          Rami Albatal
          Rami Albatal
          Ready to be merged automatically. Ask someone with write access to this repository to merge this request

          Deletes source branch

          • Discussion 4
          • Commits 8
          • Pipelines 6
          • Changes 8
          0/3 threads resolved
          • Loading...
          • Brian Hatchet :speech_balloon: @brianhatchet changed milestone to %Permission #review 16 hours ago

            changed milestone to %Permission #review

          • Brian Hatchet :speech_balloon: @brianhatchet added Sprint::09/25 - Oldfashioned Owl Squad::Green scoped labels 16 hours ago

            added Sprint::09/25 - Oldfashioned Owl Squad::Green scoped labels

          • Brian Hatchet :speech_balloon: @brianhatchet changed target branch from master to epic/permissions-28 16 hours ago

            changed target branch from master to epic/permissions-28

          • Marcelo Rivera @eiennohi approved this merge request 16 hours ago

            approved this merge request

          • Brian Hatchet :speech_balloon: @brianhatchet changed the description 2 times within 2 minutes 16 hours ago

            changed the description 2 times within 2 minutes

          • Marcelo Rivera @eiennohi added 1 commit 15 hours ago

            added 1 commit

            • fd0e5557 - (feat): channel owner should be able to create new groups

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet added 3 commits 13 hours ago

            added 3 commits

            • 05c44a86 - Exporting entities via exportable on single
            • 7f7e9b9c - Not adding my backup
            • e3689bc7 - Merge branch 'chore-refactor-permissions-export' of gitlab.com:minds/engine...

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet added 6 commits 12 hours ago

            added 6 commits

            • e3689bc7...c9daabe0 - 5 commits from branch epic/permissions-28
            • 12231b32 - Merge branch 'epic/permissions-28' into chore-refactor-permissions-export

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet added 1 commit 11 hours ago

            added 1 commit

            • 3f2d80e8 - Exporting single entities properly

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet added 1 commit 10 hours ago

            added 1 commit

            • 2b856941 - Need the manager there, Brian

            Compare with previous version

          • Brian Hatchet :speech_balloon: @brianhatchet changed the description 9 hours ago

            changed the description

          • Emiliano Balbuena @edgebal approved this merge request 8 hours ago

            approved this merge request

          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 8 minutes ago
            Api/Factory.php
            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([
            • Mark Harding
              Mark Harding @markeharding · 8 minutes ago
              Owner

              Is this doing a database call on every entity export?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 7 minutes ago
            classes/ElggEntity.php
            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
            • Mark Harding
              Mark Harding @markeharding · 7 minutes ago
              Owner

              tab?

            • Please register or sign in to reply
          • Mark Harding
            Mark Harding @markeharding started a thread on the diff 7 minutes ago
            classes/ElggEntity.php
            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
            • Mark Harding
              Mark Harding @markeharding · 7 minutes ago
              Owner

              This file needs fixing. Looks like its been resorted to tabs.

            • Please register or sign in to reply
          • Mark Harding @markeharding added MR::Requires Changes scoped label 6 minutes ago

            added MR::Requires Changes scoped label

          • Mark Harding
            Mark Harding @markeharding · 5 minutes ago
            Owner

            Composer.phar also need removing

          • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
          Please register or sign in to reply
          Assignee
          Brian Hatchet's avatar
          Brian Hatchet @brianhatchet
          Assign to
          Permission #review
          Milestone
          Permission #review
          Assign milestone
          None
          Time tracking
          No estimate or time spent
          3
          Labels
          MR::Requires Changes Sprint::09/25 - Oldfashioned Owl Squad::Green
          Assign labels
          • View project labels
          Lock merge request
          Unlocked
          10
          10 participants
          user avatar
          Mark Harding
          user avatar
          Marcelo Rivera
          user avatar
          Olivia Madrid
          user avatar
          Ben Hayward
          user avatar
          Rami Albatal
          user avatar
          Martin Santangelo
          user avatar
          Guy Thouret
          Reference: minds/engine!349