Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new Account State Suspended #2497

Open
gvagenas opened this issue Sep 12, 2017 · 5 comments · May be fixed by #2904
Open

Implement new Account State Suspended #2497

gvagenas opened this issue Sep 12, 2017 · 5 comments · May be fixed by #2904

Comments

@gvagenas
Copy link
Contributor

Currently we can only update an account to Closed state, which means all related resources (DIDs, Clients etc) will be removed and Account will be inactive.
From this state there is no way to get back to Active.

For this reason we need to implement the Suspended state which means, Account and account's resources (DIDs, Clients etc) cannot operate but are not deleted. At any time a Suspended account can move to either Active or Closed state

@gvagenas
Copy link
Contributor Author

Requirements for this issue:

  • At Admin UI make sure that both Close and Suspended actions are provided
  • At RC side, make sure when an account is Suspended all of his resources are not deleted but deactivated for example:
    • Account and Sub-Accounts cannot login.
    • Unable to register clients
    • Deny calls to DIDs
  • When account goes back to Active state, re-enable the resources.

@ddhuy
Copy link

ddhuy commented Nov 15, 2017

Hi @gvagenas , can I start investigating and do the implementation for this enhancement?

@ddhuy
Copy link

ddhuy commented Nov 23, 2017

Hi @gvagenas , when an account is Suspended, all of his Sub-Accounts will be Suspended too and when his account is activated then all of his Sub-Accounts will be activated accordingly.

But what if one of his Sub-Accounts was already in Suspended state before. If his account is suspended then activated so the already suspended sub-account will be activated too.
screenshot from 2017-11-23 21-21-29

In my opinion, we should keep the already suspended sub-account not change. I think that we should add one column in database as in below to save the previous state of an account.
image

When an account is from Active to Suspended:

  1. Its effective state & previous state will be set to Suspended
  2. Copy sub-accounts' effective state to previous state
  3. Set sub-accounts' effective state to Suspended

When an account is from Suspended to Active:

  1. Set its effective state & previous state to Active
  2. Copy sub-accounts' previous state to effective state

@gsaslis
Copy link
Contributor

gsaslis commented Nov 28, 2017

@ddhuy if I understand correctly what @gvagenas had in mind, we would not have to change the status of the sub-accounts themselves.

the requirement he has listed (that "Account and Sub-Accounts cannot login") can simply be implemented in our authorization logic.

this way, when we have to decide if a user is allowed to login, we can add the additional check of whether (one of) their parent accounts is SUSPENDED.

This way, we don't have to modify status of sub-accounts.

@gvagenas wdyt?

@ddhuy
Copy link

ddhuy commented Nov 30, 2017

@gsaslis , Thank you for the explanation. I understand it now so I will continue with the implementing.

@ddhuy ddhuy linked a pull request Apr 7, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants