Exemple #1
0
class IPrincipal(Interface):  # pylint: disable=E0239
    """Principals are security artifacts that execute actions in a security
    environment.

    The most common examples of principals include user and group objects.

    It is likely that IPrincipal objects will have associated views
    used to list principals in management interfaces. For example, a
    system in which other meta-data are provided for principals might
    extend IPrincipal and register a view for the extended interface
    that displays the extended information. We'll probably want to
    define a standard view name (e.g.  'inline_summary') for this
    purpose.
    """

    id = TextLine(
        title=_("Id"),
        description=_("The unique identification of the principal."),
        required=True,
        readonly=True,
    )

    groups = List(value_type=TextLine())

    read_permission(password="******")
    _groups_cache = Dict(
        key_type=TextLine(),
        value_type=Object(schema=Interface))  # value_type=IPrincipal

    async def set_password(new_password: str,
                           old_password: typing.Optional[str]):
        """
class ICustomContentType(IItem):

    images = Dict(
        key_type=TextLine(),
        value_type=TextLine(),
        required=False,
        defaultFactory=dict
    )
Exemple #3
0
class IRole(Interface):  # pylint: disable=E0239
    """A role object."""

    id = TextLine(title='Id',
                  description='Id as which this role will be known and used.',
                  readonly=True,
                  required=True)

    title = TextLine(title='Title',
                     description='Provides a title for the role.',
                     required=True)

    description = Text(title='Description',
                       description='Provides a description for the role.',
                       required=False)
Exemple #4
0
class IVocabulary(IItem):

    dictionary = Dict(title='Vocabulary',
                      required=False,
                      default={},
                      key_type=TextLine(title='word'),
                      value_type=Int(title='index'))

    reversed_dictionary = Dict(title='Reverse Vocabulary',
                               required=False,
                               default={},
                               key_type=Int(title='index'),
                               value_type=TextLine(title='word'))

    total = Int(title='Total documents processed')
Exemple #5
0
class IRole(Interface):
    """A role object."""

    id = TextLine(title=u"Id",
                  description=u"Id as which this role will be known and used.",
                  readonly=True,
                  required=True)

    title = TextLine(title=u"Title",
                     description=u"Provides a title for the role.",
                     required=True)

    description = Text(title=u"Description",
                       description=u"Provides a description for the role.",
                       required=False)
Exemple #6
0
class ILocation(Interface):
    """Objects that can be located in a hierachy.

    Given a parent and a name an object can be located within that parent. The
    locatable object's `__name__` and `__parent__` attributes store this
    information.

    Located objects form a hierarchy that can be used to build file-system-like
    structures. For example in Zope `ILocation` is used to build URLs and to
    support security machinery.

    To retrieve an object from its parent using its name, the `ISublocation`
    interface provides the `sublocations` method to iterate over all objects
    located within the parent. The object searched for can be found by reading
    each sublocation's __name__ attribute.

    """

    __parent__ = Attribute("The parent in the location hierarchy.")

    __name__ = TextLine(
        title=u"The name within the parent",
        description="The object can be looked up from the parent's "
        "sublocations using this name.",
        required=False,
        default=None)
Exemple #7
0
class IPermission(Interface):  # pylint: disable=E0239
    """A permission object."""

    id = TextLine(
        title=_('Id'),
        description=_('Id as which this permission will be known and used.'),
        readonly=True,
        required=True)

    title = TextLine(title=_('Title'),
                     description=_('Provides a title for the permission.'),
                     required=True)

    description = Text(
        title=_('Description'),
        description=_('Provides a description for the permission.'),
        required=False)
Exemple #8
0
class IPermission(Interface):
    """A permission object."""

    id = TextLine(
        title=_("Id"),
        description=_("Id as which this permission will be known and used."),
        readonly=True,
        required=True)

    title = TextLine(title=_("Title"),
                     description=_("Provides a title for the permission."),
                     required=True)

    description = Text(
        title=_("Description"),
        description=_("Provides a description for the permission."),
        required=False)
Exemple #9
0
class IPrincipal(Interface):  # pylint: disable=E0239
    """Principals are security artifacts that execute actions in a security
    environment.

    The most common examples of principals include user and group objects.

    It is likely that IPrincipal objects will have associated views
    used to list principals in management interfaces. For example, a
    system in which other meta-data are provided for principals might
    extend IPrincipal and register a view for the extended interface
    that displays the extended information. We'll probably want to
    define a standard view name (e.g.  'inline_summary') for this
    purpose.
    """
    groups = List(value_type=TextLine())

    id = TextLine(title=_('Id'),
                  description=_('The unique identification of the principal.'),
                  required=True,
                  readonly=True)
Exemple #10
0
class IFhirField(IObject):
    """ """

    resource_type = TextLine(title="FHIR Resource Type", required=False)
    resource_class = DottedName(
        title="FHIR Resource custom class that is based from fhir.resources",
        required=False,
    )
    resource_interface = DottedName(title="FHIR Resource Interface", required=False)
    fhir_release = ASCIILine(title="FHIR Release Version", required=True)

    def from_dict(dict_value):
        """ """
Exemple #11
0
class IPatient(IFhirContent, IContentIndex):

    index_field(
        "patient_resource",
        type="object",
        field_mapping=fhir_resource_mapping("Patient"),
        fhirpath_enabled=True,
        resource_type="Patient",
        fhir_release=FHIR_VERSION.R4,
    )
    index_field("p_type", type="keyword")
    p_type = TextLine(title="Patient Type", required=False)
    patient_resource = FhirField(title="Patient Resource",
                                 resource_type="Patient",
                                 fhir_release="R4")
Exemple #12
0
class IOrganization(IFhirContent, IContentIndex):

    index_field(
        "organization_resource",
        type="object",
        field_mapping=fhir_resource_mapping("Organization"),
        fhirpath_enabled=True,
        resource_type="Organization",
        fhir_release=FHIR_VERSION.R4,
    )
    index_field("org_type", type="keyword")
    org_type = TextLine(title="Organization Type", required=False)
    organization_resource = FhirField(title="Organization Resource",
                                      resource_type="Organization",
                                      fhir_release="R4")
Exemple #13
0
class IFhirField(IObject):
    """ """
    resource_type = TextLine(
        title='FHIR Resource Type',
        required=False,
    )
    resource_class = DottedName(
        title='FHIR Resource class from fhir.resources',
        required=False,
    )
    resource_interface = DottedName(
        title='FHIR Resource Interface',
        required=False,
    )

    def from_dict(dict_value):
        """ """
Exemple #14
0
class IMultiImageAttachment(Interface):
    images = Dict(key_type=TextLine(),
                  value_type=CloudImageFileField(),
                  default={},
                  missing_value={},
                  max_length=1000)
Exemple #15
0
class IMultiAttachment(Interface):
    files = Dict(
        key_type=TextLine(),
        value_type=CloudFileField(),
        missing_value={}
    )
Exemple #16
0
class IFhirContent(IResource):
    """ """
    resource_type = TextLine(readonly=True)