Skip to content

Commit

Permalink
remove admin restriction on creating new workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Mar 6, 2025
1 parent a6d7313 commit 70bb2d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
5 changes: 0 additions & 5 deletions daras_ai_v2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2568,11 +2568,6 @@ def additional_notes(self) -> str | None:
def get_cost_note(self) -> str | None:
pass

def can_user_see_workspaces(self) -> bool:
return bool(self.request.user) and (
self.is_current_user_admin() or len(self.request.user.cached_workspaces) > 1
)

def is_current_user_admin(self) -> bool:
return self.is_user_admin(self.request.user)

Expand Down
29 changes: 14 additions & 15 deletions workspaces/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,20 @@ def global_workspace_selector(user: AppUser, session: dict):
)

if current.is_personal:
if BasePage.is_user_admin(user):
gui.html('<hr class="my-1"/>')
with gui.tag(
"button",
className="bg-transparent border-0 text-start bg-hover-light px-3 my-1",
name="--create-workspace",
type="submit",
value="yes",
style=dict(height=row_height),
):
with gui.div(className="row align-items-center"):
with gui.div(className="col-2 d-flex justify-content-center"):
gui.html(icons.octopus)
with gui.div(className="col-10"):
gui.html("New Team Workspace")
gui.html('<hr class="my-1"/>')
with gui.tag(
"button",
className="bg-transparent border-0 text-start bg-hover-light px-3 my-1",
name="--create-workspace",
type="submit",
value="yes",
style=dict(height=row_height),
):
with gui.div(className="row align-items-center"):
with gui.div(className="col-2 d-flex justify-content-center"):
gui.html(icons.octopus)
with gui.div(className="col-10"):
gui.html("New Team Workspace")
else:
gui.html('<hr class="my-1"/>')
with gui.link(
Expand Down

0 comments on commit 70bb2d8

Please sign in to comment.