You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/09/22 03:47:23 UTC

[GitHub] [incubator-superset] FrankScarlet opened a new issue #10992: Is there any way to manage(add) users at a large scale?

FrankScarlet opened a new issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992


   **Is your feature request related to a problem? Please describe.**
   
   It is easy and user-friendly to add a user via `List Users` page. I suppose the command `superset fab createuser` will achieve the same goal with a prompt. But I'm frustrated when I try to create a batch of users. For example, I want to add four different users as public role with default password. Repeatedly filling forms is not a good idea.
   
   I guess the user management is related to `.superset\superset.db`. Connect to the database and insert values should do the job.
   
   **Describe the solution you'd like**
   
   1. An admin user could download a sample csv/xlsx(with header). The admin will fill the table or write some code snippets to generate the correct csv/xlsx(with header). 
   
   2. The admin upload the csv through a superset page. After the process of the csv, the page is refreshed and lists all the users(or part of it with `N users in total are created` message printed).
   
   e.g. 
   
   | First Name      | Last Name     | User Name   | Active     | Email     | Role  | Password|
   | :------------- | :----------: | -----------: |:------------- | :----------: | -----------: | -----------: |
   |  Frank | Scarlet   | Scarlet  | 1 | hferfrank@gmail.com | Public | P@ssword |  
   
   **Describe alternatives you've considered**
   
   `A clear and concise description of any alternative solutions or features you've considered.`
   
   **Additional context**
   
   `Add any other context or screenshots about the feature request here.`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] issue-label-bot[bot] commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
issue-label-bot[bot] commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696491437


   Issue-Label Bot is automatically applying the label `#enhancement` to this issue, with a confidence of 0.79. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! 
   
    Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/apache/incubator-superset) and [code](https://github.com/hamelsmu/MLapp) for this bot.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] dpgaspar commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696627726


   @FrankScarlet,
   
   Like @mistercrunch suggested you can use SQLAlchemy (ORM) to create user's with multiple roles, here's what the cli is calling behind the scenes: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/security/sqla/manager.py#L185
    


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696500392


   > @FrankScarlet why don't you just write a script that calls `flask fab create-user`? You can pass flags instead of following the prompts, eg
   > 
   > ```shell
   > flask fab create-user --role Public --username user1 --firstname name1 --lastname name2 --email user@example.com --password cool-password
   > ```
   
   Thanks a lot. I tried `superset fab create-user`. But I thought it only works in an interactive style.
   With your answer I can come up with a script to achieve my goal. 
   
   I am still thinking about possible problems in users management. So I won't close this issue immediately


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] dpgaspar commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696627726


   @FrankScarlet,
   
   Like @mistercrunch suggested you can use SQLAlchemy (ORM) to create user's with multiple roles, here's what the cli is calling behind the scenes: https://github.com/dpgaspar/Flask-AppBuilder/blob/master/flask_appbuilder/security/sqla/manager.py#L185
    


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] issue-label-bot[bot] commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
issue-label-bot[bot] commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696491437


   Issue-Label Bot is automatically applying the label `#enhancement` to this issue, with a confidence of 0.79. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! 
   
    Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/apache/incubator-superset) and [code](https://github.com/hamelsmu/MLapp) for this bot.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai closed issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
nytai closed issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696504859


   You can also do it through the ORM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai closed issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
nytai closed issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696544186


   @nytai `--role Public` seems Great.
   But I find that the combination of  `sql_lab, Gamma, Public` suits my need. I tried to pass multiple flags but failed.
   ```shell
   # --role Public Gamma sql_lab
   # --role [Public, Gamma, sql_lab]
   Error: Got unexpected extra arguments 
   ````
   
   It seems like that I should create a new role with adding the permissions all together. Is there any way to quickly duplicate a role? I would like to duplicate a Gamma role and add permission of sql_lab and public manually. 
   
   Gamma role owns so many permissions. It is a little bit annoying to add permission again and again.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-697067245


   Closing this issue as it it appears all questions have been addressed 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696495379


   @FrankScarlet why don't you just write a script that calls `flask fab create-user`? You can pass flags instead of following the prompts, eg
   ```bash
   flask fab create-user --role Public --username user1 --firstname name1 --lastname name2 --email user@example.com --password cool-password
   
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696500392






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-698088406


   > Add a related issue.
   > #3083
   > 
   > I think the bs4 post method mentioned in this issue is also very helpful.
   > 
   > ```python
   > users = [{
   >     'first_name': 'fname',
   >     'last_name':'lname',
   >     'username': 'cplc',
   >     'email': 'cplc@gdpost.com',
   >     'password': 'cplcapp',
   >     'conf_password': 'cplcapp',
   >     'roles': ['2', '4', '6'] 
   > }] # It's related to the roles db(ID i guess). the `roles` list correponds to [ 'Public','Gamma','sql_lab']
   > for user in users:
   >     payload = {'first_name': user['first_name'],
   >                'last_name': user['last_name'],
   >                'username': user['username'],
   >                'email': user['email'],
   >                'active': True,
   >                'conf_password': user['password'],
   >                'password': user['password'],
   >                'roles': user['roles']
   >                } 
   >     print(superset.post(url_path='users/add', json=payload))
   > ```
   
   Ooops, is this method limited? I test a json which includes three users but only the first user was added.
   `users=[{}, {} ...]` 
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-697593149


   Add a related issue. 
   https://github.com/apache/incubator-superset/issues/3083
   
   I think the bs4 post method mentioned in this issue is also very helpful.
   ```python
   users = [{
       'first_name': 'fname',
       'last_name':'lname',
       'username': 'cplc',
       'email': 'cplc@gdpost.com',
       'password': 'cplcapp',
       'conf_password': 'cplcapp',
       'roles': ['2', '4', '6'] 
   }] # It's related to the roles db(ID i guess). the `roles` list correponds to [ 'Public','Gamma','sql_lab']
   for user in users:
       payload = {'first_name': user['first_name'],
                  'last_name': user['last_name'],
                  'username': user['username'],
                  'email': user['email'],
                  'active': True,
                  'conf_password': user['password'],
                  'password': user['password'],
                  'roles': user['roles']
                  } 
       print(superset.post(url_path='users/add', json=payload))
   ```
   
   On the other hand, did the SQLAlchemy (ORM) means sth like the method given at the beginning of the above issue
   
   [gist.py](https://gist.github.com/pajachiet/62eb85805cee55053d208521e0bdaf13#file-create_superset_users-py)
   
   ```python
   create_engine('superset.db') # connect to the role database
   insert into some values according to a csv
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] mistercrunch commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
mistercrunch commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696504859


   You can also do it through the ORM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] nytai commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-696495379






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] FrankScarlet commented on issue #10992: Is there any way to manage(add) users at a large scale?

Posted by GitBox <gi...@apache.org>.
FrankScarlet commented on issue #10992:
URL: https://github.com/apache/incubator-superset/issues/10992#issuecomment-698088406


   > Add a related issue.
   > #3083
   > 
   > I think the bs4 post method mentioned in this issue is also very helpful.
   > 
   > ```python
   > users = [{
   >     'first_name': 'fname',
   >     'last_name':'lname',
   >     'username': 'cplc',
   >     'email': 'cplc@gdpost.com',
   >     'password': 'cplcapp',
   >     'conf_password': 'cplcapp',
   >     'roles': ['2', '4', '6'] 
   > }] # It's related to the roles db(ID i guess). the `roles` list correponds to [ 'Public','Gamma','sql_lab']
   > for user in users:
   >     payload = {'first_name': user['first_name'],
   >                'last_name': user['last_name'],
   >                'username': user['username'],
   >                'email': user['email'],
   >                'active': True,
   >                'conf_password': user['password'],
   >                'password': user['password'],
   >                'roles': user['roles']
   >                } 
   >     print(superset.post(url_path='users/add', json=payload))
   > ```
   
   Ooops, is this method limited? I test a json which includes three users but only the first user was added.
   `users=[{}, {} ...]` 
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org