Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
tenant level user cannot access provider API
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilkp93 committed Nov 4, 2024
1 parent fd59110 commit 2d24139
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions catalystwan/api/mtt_aaa_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from catalystwan.dataclasses import TenantAAA, TenantRadiusServer, TenantTacacsServer
from catalystwan.exceptions import CatalystwanException
from catalystwan.utils.creation_tools import asdict, create_dataclass
from catalystwan.models.tenant import TenantExport

if TYPE_CHECKING:
from catalystwan.session import ManagerSession
Expand Down Expand Up @@ -40,10 +39,6 @@ def __init__(self, session: ManagerSession) -> None:
def __str__(self) -> str:
return str(self.session)

@property
def tenant_id(self):
return self.session.get_tenant_id()

def aaa_exists(self) -> bool:
return True if self.session.get_data(self.url_path) else False

Expand All @@ -68,7 +63,7 @@ def get_aaa(self) -> TenantAAA:
:param aaa:
:return:
"""
logger.debug(f"AAA config {self.tenant_id}.")
logger.debug(f"AAA config .")
tenant_aaa = self.session.get_data(self.url_path)
# return tenant_aaa
return create_dataclass(TenantAAA, tenant_aaa)
Expand All @@ -80,8 +75,8 @@ def del_aaa(self):
:return:
"""
if not self.aaa_exists():
raise AAAConfigNotPresent(f"No AAA config present for Tenant id={self.tenant_id}")
logger.debug(f"Delete AAA config on tenant_id={self.tenant_id}.")
raise AAAConfigNotPresent(f"No AAA config present for Tenant")
logger.debug(f"Delete AAA config on tenant.")
return self.session.delete(self.url_path)

@status_ok
Expand Down

0 comments on commit 2d24139

Please sign in to comment.