Skip to content

Commit

Permalink
Adding enum for permission
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush-cohere committed Oct 7, 2024
1 parent 770588c commit 33bfc5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compass_sdk/rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def create_entities(url: str, headers: Headers, entity_request: List[T], entity_
return [entity_response.model_validate(response) for response in response.json()]

@staticmethod
def delete_entities(self, url: str, headers: Headers, names: List[str], entity_response: Type[U]) -> List[U]:
def delete_entities(url: str, headers: Headers, names: List[str], entity_response: Type[U]) -> List[U]:
entities = ",".join(names)
response = requests.delete(f"{url}/{entities}", headers=headers)
CompassRootClient.raise_for_status(response)
Expand Down
10 changes: 9 additions & 1 deletion compass_sdk/types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import Enum
from typing import List

from pydantic import BaseModel
Expand Down Expand Up @@ -40,9 +41,16 @@ class GroupUserDeleteResponse(BaseModel):
user_name: str


class Permission(Enum):
READ = "read"
WRITE = "write"
ADMIN = "admin"
ROOT = "root"


class PolicyRequest(BaseModel):
indexes: List[str]
permission: str
permission: Permission


class PolicyResponse(BaseModel):
Expand Down

0 comments on commit 33bfc5e

Please sign in to comment.