Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
b90b1766
Commit
b90b1766
authored
4 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into f-exception-handling
parents
c0540db9
20011d01
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/caosdb/utils/caosdb_admin.py
+5
-5
5 additions, 5 deletions
src/caosdb/utils/caosdb_admin.py
src/doc/administration.rst
+14
-0
14 additions, 0 deletions
src/doc/administration.rst
src/doc/index.rst
+2
-1
2 additions, 1 deletion
src/doc/index.rst
with
21 additions
and
6 deletions
src/caosdb/utils/caosdb_admin.py
+
5
−
5
View file @
b90b1766
...
...
@@ -141,20 +141,20 @@ def do_set_user_password(args):
def
do_add_user_roles
(
args
):
roles
=
admin
.
_get_roles
(
user
=
args
.
user_name
,
realm
=
None
)
roles
=
admin
.
_get_roles
(
user
name
=
args
.
user_name
,
realm
=
None
)
for
r
in
args
.
user_roles
:
roles
.
add
(
r
)
admin
.
_set_roles
(
user
=
args
.
user_name
,
roles
=
roles
)
admin
.
_set_roles
(
user
name
=
args
.
user_name
,
roles
=
roles
)
def
do_remove_user_roles
(
args
):
roles
=
admin
.
_get_roles
(
user
=
args
.
user_name
,
realm
=
None
)
roles
=
admin
.
_get_roles
(
user
name
=
args
.
user_name
,
realm
=
None
)
for
r
in
args
.
user_roles
:
if
r
in
roles
:
roles
.
remove
(
r
)
admin
.
_set_roles
(
user
=
args
.
user_name
,
roles
=
roles
)
admin
.
_set_roles
(
user
name
=
args
.
user_name
,
roles
=
roles
)
def
do_set_user_entity
(
args
):
...
...
@@ -178,7 +178,7 @@ def do_delete_user(args):
def
do_retrieve_user_roles
(
args
):
print
(
admin
.
_get_roles
(
user
=
args
.
user_name
))
print
(
admin
.
_get_roles
(
user
name
=
args
.
user_name
))
def
do_retrieve_role_permissions
(
args
):
...
...
This diff is collapsed.
Click to expand it.
src/doc/administration.rst
0 → 100644
+
14
−
0
View file @
b90b1766
Administration
==============
The Python script ``caosdb_admin.py`` should be used for administrative tasks.
Call ``python3 caosdb_admin.py --help`` to see how to use it.
The most common task is to create a new user (in the CaosDB realm) and set a
password for the user (note that a user typically needs to be activated)::
python3 caosdb_admin.py create_user anna
python3 caosdb_admin.py set_user_password anna
python3 caosdb_admin.py add_user_roles anna administration
python3 caosdb_admin.py activate_user anna
This diff is collapsed.
Click to expand it.
src/doc/index.rst
+
2
−
1
View file @
b90b1766
...
...
@@ -10,7 +10,8 @@ Welcome to PyCaosDB's documentation!
Getting started <README_SETUP>
tutorials/index
Concepts <concepts>
Configuration <configuration>
Configuration <configuration>
Administration <administration>
API documentation<_apidoc/modules>
This is the documentation for the Python client library for CaosDB, ``PyCaosDB``.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment