mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added settings tool lib with is_password_required function
This commit is contained in:
parent
e7d1651cff
commit
3669436aa1
1 changed files with 16 additions and 0 deletions
16
openpype/tools/settings/lib.py
Normal file
16
openpype/tools/settings/lib.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
def is_password_required():
|
||||
from openpype.settings import (
|
||||
get_system_settings,
|
||||
get_local_settings
|
||||
)
|
||||
|
||||
system_settings = get_system_settings()
|
||||
password = system_settings["general"].get("admin_password")
|
||||
if not password:
|
||||
return False
|
||||
|
||||
local_settings = get_local_settings()
|
||||
is_admin = local_settings.get("general", {}).get("is_admin", False)
|
||||
if is_admin:
|
||||
return False
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue