Skip to content

Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 870
    • Issues 870
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 46
    • Merge Requests 46
  • 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 FrontendMinds Frontend
  • Merge Requests
  • !581

Open
Opened 1 hour ago by Marcelo Rivera@eiennohi
  • Report abuse
Report abuse

WIP: Permissions

Check out, review, and merge locally

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

git fetch origin
git checkout -b "epic/permissions-28" "origin/epic/permissions-28"

Step 2. Review the changes locally

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

git fetch origin
git checkout "origin/master"
git merge --no-ff "epic/permissions-28"

Step 4. Push the result of the merge to GitLab

git push origin "master"

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 epic/permissions-28 into master
The source branch is 12 commits behind the target branch
Open in Web IDE
  • Email patches
  • Plain diff
Pipeline #87366251 running for 9d526914 on epic/permissions-28
              Requires 3 more approvals from Devs, Deployers, and QA.
              Emiliano Balbuena
              Emiliano Balbuena
              Mark Harding
              Mark Harding
              Brian Hatchet
              Brian Hatchet
              Xander Miller
              Xander Miller
              This is a Work in Progress

              Deletes source branch

              You can merge this merge request manually using the
              • Discussion 13
              • Commits 34
              • Pipelines 17
              • Changes 49
              6/10 threads resolved
              • Loading...
              • Marcelo Rivera @eiennohi changed milestone to %Permission #review 1 hour ago

                changed milestone to %Permission #review

              • Marcelo Rivera @eiennohi added Sprint::09/25 - Oldfashioned Owl Squad::Green scoped labels 1 hour ago

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

              • Mark Harding @markeharding added MR::Requires Changes Product::Security scoped labels 1 hour ago

                added MR::Requires Changes Product::Security scoped labels

              • Marcelo Rivera @eiennohi added 1 commit 1 hour ago

                added 1 commit

                • 9ace96a7 - (fix): spec tests

                Compare with previous version

              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 41 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 41 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 1 hour ago
                Last updated by Marcelo Rivera 27 minutes ago
                src/app/common/components/thumbs/thumbs-down.component.ts
                43 private modal: SignupModalService
                47 private modal: SignupModalService,
                48 private permissionsService: PermissionsService,
                49 private featuresService: FeaturesService
                44 50 ) {}
                45 51
                46 set _object(value: any) {
                52 @Input('object') set _object(value: any) {
                47 53 this.object = value;
                48 54 if (!this.object['thumbs:down:user_guids'])
                49 55 this.object['thumbs:down:user_guids'] = [];
                56
                57 this.checkPermissions();
                58 }
                59
                60 private checkPermissions() {
                • Mark Harding
                  Mark Harding @markeharding · 1 hour ago
                  Owner

                  return type?

                • Marcelo Rivera
                  Marcelo Rivera @eiennohi · 27 minutes ago
                  Developer

                  We can't have return types in set accessors: image

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 1 hour ago
                Last updated by Marcelo Rivera 27 minutes ago
                src/app/common/components/thumbs/thumbs-up.component.ts
                52 private permissionsService: PermissionsService,
                53 private featuresService: FeaturesService,
                48 54 private cd: ChangeDetectorRef
                49 55 ) {}
                50 56
                51 set _object(value: any) {
                57 @Input('object') set _object(value: any) {
                52 58 if (!value) return;
                53 59 this.object = value;
                54 60 if (!this.object['thumbs:up:user_guids'])
                55 61 this.object['thumbs:up:user_guids'] = [];
                62
                63 this.checkPermissions();
                64 }
                65
                66 private checkPermissions() {
                • Mark Harding
                  Mark Harding @markeharding · 1 hour ago
                  Owner

                  return type void

                • Marcelo Rivera
                  Marcelo Rivera @eiennohi · 27 minutes ago
                  Developer

                  We can't have return types in set accessors: image

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on the diff 1 hour ago
                src/app/common/services/permissions/flags.ts
                1 export enum Flags {
                • Mark Harding
                  Mark Harding @markeharding · 1 hour ago
                  Owner

                  What is our plan for keeping this in sync with backend?

                • Please register or sign in to reply
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 26 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 25 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 25 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Resolved by Marcelo Rivera 23 minutes ago
              • Mark Harding
                Mark Harding @markeharding started a thread on an old version of the diff 1 hour ago
                Last updated by Marcelo Rivera 17 minutes ago
                src/index.php
                146 146 "environment" => getenv('MINDS_ENV') ?: 'development',
                147 147 ];
                148 148
                149 if(Minds\Core\Session::isLoggedIn()){
                150 $minds['user'] = Minds\Core\Session::getLoggedinUser()->export();
                151 $minds['user']['rewards'] = !!Minds\Core\Session::getLoggedinUser()->getPhoneNumberHash();
                152 $minds['wallet'] = array('balance' => Minds\Helpers\Counters::get(Minds\Core\Session::getLoggedinUser()->guid, 'points', false));
                149 if (Minds\Core\Session::isLoggedIn()) {
                150 $user = Minds\Core\Session::getLoggedinUser();
                151 $minds['user'] = $user->export();
                152 $minds['user']['rewards'] = !!Minds\Core\Session::getLoggedinUser()->getPhoneNumberHash();
                153 $minds['wallet'] = array('balance' => Minds\Helpers\Counters::get(Minds\Core\Session::getLoggedinUser()->guid, 'points', false));
                154
                155 if(Minds\Core\Di\Di::_()->get('Features\Manager')->has('permissions')) {
                • Mark Harding
                  Mark Harding @markeharding · 1 hour ago
                  Owner

                  spacing. Also I'm not sure if window is the correct place for this. Especially with forward planning the SSR work

                • Marcelo Rivera
                  Marcelo Rivera @eiennohi · 22 minutes ago
                  Developer

                  If we're going to replace this code with an endpoint call, then it'd be just as easy as removing this from here and making sure that endpoint injects the permissions.

                • Marcelo Rivera @eiennohi changed this line in version 3 of the diff 17 minutes ago

                  changed this line in version 3 of the diff

                • Please register or sign in to reply
              • Marcelo Rivera @eiennohi added 3 commits 17 minutes ago

                added 3 commits

                • 3dd7a390 - (feat): enforce edit_post and delete_post for activities, blogs
                • 81f67f0a - (fix): add return types
                • 4eb519c4 - (fix): spacing

                Compare with previous version

              • Marcelo Rivera @eiennohi added 1 commit 7 minutes ago

                added 1 commit

                • 9d526914 - (fix): spec tests

                Compare with previous version

              • 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
              0 Assignees
              None
              Assign to
              Permission #review
              Milestone
              Permission #review
              Assign milestone
              None
              Time tracking
              No estimate or time spent
              4
              Labels
              MR::Requires Changes Product::Security Sprint::09/25 - Oldfashioned Owl Squad::Green
              Assign labels
              • View project labels
              Lock merge request
              Unlocked
              10
              10 participants
              user avatar
              Ben Hayward
              user avatar
              Emiliano Balbuena
              user avatar
              Mark Harding
              user avatar
              Martin Santangelo
              user avatar
              Juan Manuel Solaro
              user avatar
              Guy Thouret
              user avatar
              Brian Hatchet
              Reference: minds/front!581