@startuml
package "api_concept.entities/persmission_grant" {
  class PermissionGrantInterface<APIObject> {
    + object_type : str
  }
}

note left of PermissionGrantInterface::object_type
    Тип объекта выдаваемого доступа
endnote

package "api_concept.entities/maas" {
  class MaasOrganizationInterface<APIObject> {
  }
}

package "maas/api/impl/organization" {
  class MaasOrganization {
    + {field} PERMISSIONS_COLLECTION = db.main().permission_grants
    + share_grant(\n grantee_id,\n permission\n)
  }
}

package "api_concept.backend/impl/permission_grant" {
  class PermissionGrant {
    + {field} COLLECTION = db.main().ivideon.permission_grants
    + find()
  }

  class ALL_OBJECT_TYPES<list> {
    + items : list = ['camera', 'cashbox', 'face_gallery', 'folder']
  }
}

package "utils/folder.tree" {
  class NodeType<dict> {
    + camera : Camera
    + cashbox : Cashbox
    + face_gallery : FaceGallery
  }
}

package "utils/folder.node"{
  class Node
  class Camera
  class Cashbox
  class FaceGallery
}

note left of Node
Базовый класс для концевых узлов дерева
(объекты, содержащиеся в Folders)
end note

note right of PermissionGrant
Метод поиска грантов (find)
end note

note top of ALL_OBJECT_TYPES
Перечисление объектов,
которые можно искать
end note

Node <|-- Camera
Node <|-- Cashbox
Node <|-- FaceGallery

ALL_OBJECT_TYPES .. NodeType

NodeType::camera .. Camera
NodeType::cashbox .. Cashbox
NodeType::face_gallery .. FaceGallery

PermissionGrantInterface <|-- PermissionGrant

MaasOrganizationInterface <|-- MaasOrganization

@enduml