diff --git a/common/pyproject.toml b/common/pyproject.toml index 89728ee7..b82798c8 100644 --- a/common/pyproject.toml +++ b/common/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaredaqlib" -version = "0.2.66" +version = "0.2.67" description = "Libraries shared between AareDAQ and AareGUI" readme = "README.md" requires-python = ">=3.11" diff --git a/common/src/aaredaqlib/models.py b/common/src/aaredaqlib/models.py index 1eb4e2d6..af771831 100644 --- a/common/src/aaredaqlib/models.py +++ b/common/src/aaredaqlib/models.py @@ -382,6 +382,7 @@ class SampleShortInfo(BaseModel): puck_name: str dewar_name: str sample_name: str + run_number: int aaredb_params: Optional[DataCollectionParameters] = None user: str = "" pin: Annotated[int, Field(ge=1, le=16)] diff --git a/daq/pyproject.toml b/daq/pyproject.toml index e50b7822..b28f5564 100644 --- a/daq/pyproject.toml +++ b/daq/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaredaq" -version = "0.2.65" +version = "0.2.67" description = "AareDAQ data acquisition server" readme = "README.md" requires-python = ">=3.11" diff --git a/daq/src/aaredaq/auth.py b/daq/src/aaredaq/auth.py index 7690ff63..e293f9ae 100644 --- a/daq/src/aaredaq/auth.py +++ b/daq/src/aaredaq/auth.py @@ -21,7 +21,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES = 24 * 60 * 7 # 1 week SESSION_EXPIRE_SECONDS = 60 * 10 STAFF_GROUP = "unx-MXgroup" - +SUPER_USERS = ["e10019", "e11206", "e18147"] class TokenData(BaseModel): sub: str # Username @@ -42,9 +42,9 @@ def authenticate_user(cfg: BeamlineConfig, form_data: OAuth2PasswordRequestForm) groups = os.getgrouplist(user_info.pw_name, user_info.pw_gid) supplementary_groups = [grp.getgrgid(g).gr_name.lower() for g in groups] - + super_user = form_data.username in SUPER_USERS pgroups = [group for group in supplementary_groups if group.startswith('p')] - staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups + staff = "unx-mxgroup" in supplementary_groups or "unx-sls_mx" in supplementary_groups or super_user token = TokenData(sub=form_data.username, pgroups=pgroups, staff=staff, diff --git a/daq/src/aaredaq/server.py b/daq/src/aaredaq/server.py index 7ea166a7..1b7a19dd 100644 --- a/daq/src/aaredaq/server.py +++ b/daq/src/aaredaq/server.py @@ -226,6 +226,7 @@ async def sample(token: str = Depends(oauth2_scheme)) -> SampleShortInfo: else: return SampleShortInfo( sample_name="Other user sample", + run_number=0, puck_name="", dewar_name="", db_id=-1, diff --git a/gui/pyproject.toml b/gui/pyproject.toml index 8d68e539..d26e54b0 100644 --- a/gui/pyproject.toml +++ b/gui/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "aaregui" -version = "0.2.66" +version = "0.2.67" description = "Beamline control GUI" readme = "README.md" requires-python = ">=3.11" diff --git a/gui/src/aaregui/panels/manual_sample_panel.py b/gui/src/aaregui/panels/manual_sample_panel.py index 9693cdf2..5dce6884 100644 --- a/gui/src/aaregui/panels/manual_sample_panel.py +++ b/gui/src/aaregui/panels/manual_sample_panel.py @@ -112,6 +112,7 @@ class ManualSamplePanel(QWidget): puck_name="", dewar_name="", sample_name=self.__sample_name, + run_number=1, #can't be -1. So have defaulted to 1 for now. pin=1, aaredb_params=data_processing, user=self.__pgroup,