File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -179,3 +179,19 @@ def update_last_interaction(user_id: str) -> None:
179
179
user_item = get (user_id )
180
180
user_item .last_interaction = sql .func .now ()
181
181
general .commit ()
182
+
183
+
184
+ def check_email_in_full_admin (email : str ) -> bool :
185
+ email = email .lower ()
186
+ email = prevent_sql_injection (email , isinstance (email , str ))
187
+ query = f"""
188
+ SELECT EXISTS (
189
+ SELECT 1
190
+ FROM global.full_admin_access
191
+ WHERE email = '{ email } '
192
+ )
193
+ """
194
+ result = general .execute_first (query )
195
+ if result and result [0 ]:
196
+ return True
197
+ return False
Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ class Tablenames(Enum):
154
154
EVALUATION_GROUP = "evaluation_group"
155
155
EVALUATION_RUN = "evaluation_run"
156
156
PLAYGROUND_QUESTION = "playground_question"
157
+ FULL_ADMIN_ACCESS = "full_admin_access"
157
158
158
159
def snake_case_to_pascal_case (self ):
159
160
# the type name (written in PascalCase) of a table is needed to create backrefs
Original file line number Diff line number Diff line change @@ -2062,3 +2062,11 @@ class PlaygroundQuestion(Base):
2062
2062
# )
2063
2063
# record_ids = Column(JSON)
2064
2064
# meta_info = Column(JSON)
2065
+
2066
+
2067
+ class FullAdminAccess (Base ):
2068
+ __tablename__ = Tablenames .FULL_ADMIN_ACCESS .value
2069
+ __table_args__ = {"schema" : "global" }
2070
+ id = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
2071
+ email = Column (String , unique = True )
2072
+ meta_info = Column (JSON )
You can’t perform that action at this time.
0 commit comments