def set(key, permission):
    """Set the credentials the current user have to access a feature.

        If the feature should be completely disabled (user cannot access the
        feature), permission should be 0.

        If the key is a domain object, available credentials are: PERM_SEARCH,
        PERM_CREATE, PERM_EDIT, PERM_DETAILS. This credentials are used by
        SearchEditors and will disable/enable create, edit and details button.

        If the key is a menu action, the only credential is PERM_ACCESS. If the
        user has it, he will be allowed to access the feature, oherwise it will
        be hidden.

        :param key: String identifing the feature. This should be the name of
                    the domain object (Product, Client, etc..), or an
                    identifier for the related menu action (app.admin.new_order,
                    for instance).
        :param permission: The credentials the current user has for accessing
                    the feature.
        """
