Skip to content

mappers

MLTE user store mappers interface.

GroupMapper

Bases: ResourceMapper

A interface for mapping CRUD actions to store groups.

Source code in mlte/store/user/mappers.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class GroupMapper(ResourceMapper):
    """A interface for mapping CRUD actions to store groups."""

    def create(self, new_group: Group, context: Any = None) -> Group:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def edit(self, updated_group: Group, context: Any = None) -> Group:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def read(self, group_id: str, context: Any = None) -> Group:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def list(self, context: Any = None) -> List[str]:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def delete(self, group_id: str, context: Any = None) -> Group:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

PermissionMapper

Bases: ResourceMapper

A interface for mapping CRUD actions to store permissions.

Source code in mlte/store/user/mappers.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class PermissionMapper(ResourceMapper):
    """A interface for mapping CRUD actions to store permissions."""

    def create(
        self, new_permission: Permission, context: Any = None
    ) -> Permission:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def edit(
        self, updated_permission: Permission, context: Any = None
    ) -> Permission:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def read(self, permission: str, context: Any = None) -> Permission:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def list(self, context: Any = None) -> List[str]:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def delete(self, permission: str, context: Any = None) -> Permission:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

UserMapper

Bases: ResourceMapper

An interface for mapping CRUD actions to store users.

Source code in mlte/store/user/mappers.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class UserMapper(ResourceMapper):
    """An interface for mapping CRUD actions to store users."""

    def create(self, new_user: UserWithPassword, context: Any = None) -> User:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def edit(
        self,
        updated_user: Union[UserWithPassword, BasicUser],
        context: Any = None,
    ) -> User:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def read(self, user_id: str, context: Any = None) -> User:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def list(self, context: Any = None) -> List[str]:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)

    def delete(self, user_id: str, context: Any = None) -> User:
        raise NotImplementedError(self.NOT_IMPLEMENTED_ERROR_MSG)