Skip to content

Comments

[NEW] Option to prevent users from using Invisible status#20084

Merged
sampaiodiego merged 14 commits intodevelopfrom
disable-invisible-mode
May 5, 2021
Merged

[NEW] Option to prevent users from using Invisible status#20084
sampaiodiego merged 14 commits intodevelopfrom
disable-invisible-mode

Conversation

@lucassartor
Copy link
Contributor

@lucassartor lucassartor commented Jan 6, 2021

Proposed changes (including videos or screenshots)

Add an admin option to allow/disallow the Invisible status option from all users. This option is available in the Accounts section.

2021-01-06-11-55-22

If the option is turned off, the users.setStatus endpoint is also restricted from users trying to change their status to Invisible, throwing the following error:

{
    "success": false,
    "error": "Invisible status is disabled [error-not-allowed]",
    "stack": "Error: Invisible status is disabled [error-not-allowed]\n    at DDPCommon.MethodInvocation.<anonymous> (app/api/server/v1/users.js:425:13)\n    at packages/dispatch_run-as-user.js:211:14\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)\n    at Object.Meteor.runAsUser (packages/dispatch_run-as-user.js:210:33)\n    at Object.post (app/api/server/v1/users.js:415:10)\n    at app/api/server/api.js:394:82\n    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1234:12)\n    at Object._internalRouteActionHandler [as action] (app/api/server/api.js:394:39)\n    at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)\n    at packages/nimble_restivus/lib/route.coffee:59:33\n    at packages/simple_json-routes.js:98:9",
    "errorType": "error-not-allowed",
    "details": {
        "method": "users.setStatus"
    }
}

Issue(s)

Fixes #5020

Steps to test or reproduce

  1. Login as a user that has the admin role
  2. Go to the Administration->Accounts section
  3. Disable the option to see the changes in the user's status

Further comments

@tmartincpp
Copy link

Really nice feature, thank you! Hope this will be able to be included in the future.

@sampaiodiego sampaiodiego changed the title [NEW] Admin option to disable users Invisible status [NEW] Option to prevent users from using Invisible status May 5, 2021
@sampaiodiego sampaiodiego merged commit 525f451 into develop May 5, 2021
@sampaiodiego sampaiodiego deleted the disable-invisible-mode branch May 5, 2021 19:35
@sampaiodiego sampaiodiego mentioned this pull request May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable "invisibility mode"

3 participants